A man from among the companions of the Prophet ﷺ was wounded, and the wound caused him great suffering. He crawled to a set of arrowheads and slit his own throat with them. The Prophet ﷺ did not perform the funeral prayer over him. He said, this was done by him as a form of discipline.
حدثنا عبد الله بن عامر بن زرارة حدثنا شريك بن عبد الله عن سماك بن حرب
أن رجلا من أصحاب النبي ﷺ جرح فآذته الجراحة فدب إلى مشاقص فذبح بها نفسه فلم يصل عليه النبي ﷺ قال وكان ذلك منه أدبا
Reported by Muslim, Funerals, Chapter on refraining from praying over one who kills himself, no. 978, and Tirmidhi, no. 1068, and others besides them, through routes from Simak, in an abridged form, and Tirmidhi said, hasan sahih.