One possible reason could be mental distress. He might be suffering from depression or some other psychological disorder that made him feel hopeless. Maybe he had financial problems, lost his job, or had relationship issues.
There could be underlying medical reasons as well. He might have been experiencing some form of undiagnosed neurological disorder that affected his mental state. Sometimes, people with certain brain conditions can have suicidal thoughts or engage in self - harm without fully realizing the consequences.
It could also be due to an impulsive act. For example, he might have been under the influence of drugs or alcohol which impaired his judgment. Or perhaps he had a sudden and extreme emotional reaction to a particular event that he couldn't handle in the moment.