It sounds like a bad anxiety habit. I was sort of like that. Therapy and hard work might help. You have to work on the anxiety that is causing the suicide thoughts (the scariest thing there can be, things can't get worse than suicide so it's almost "comforting", it's a "bottom"/base to our thoughts) and the defensive habit that has developed of blurting out the opposite about killing/hurting others. Whenever I got really scared and could hardly function, I'd throw an imaginary hand grenade into my own foxhole

and "start over". I don't do that anymore, I can deal with my anxieties and work to make things how I want them to be. But it took a whole lot of psychotherapy.