Émile Durkheim said this quote

Maniacal suicide. —This is due to hallucinations or delirious conceptions. The patient kills himself to escape from an imaginary danger or disgrace, or to obey a mysterious order from on high, etc.