I visited Khabab when he had been cauterized seven times on his stomach, and he said, "Were it not that the Messenger of Allah ﷺ forbade us from praying for death, I would have prayed for it."
أخبرنا محمد بن بشار قال حدثنا يحيى بن سعيد قال حدثنا إسمعيل قال
دخلت على خباب وقد اكتوى في بطنه سبعا وقال لولا أن رسول الله ﷺ نهانا أن ندعو بالموت دعوت به
Bukhari reported it in the Book of Supplications, Chapter on Supplicating for Death and Life, hadith no. 6349, from the hadith of Yahya Qattan, and Muslim, hadith no. 2681 (see the previous hadith), from the hadith of Ismail bin Abu Khalid, with this wording. It is also in Al-Kubra, hadith no. 1949.