I think shminux was referring to
The reason you think these thoughts more when you are embarrassed or feel low-status is more likely that those things make you feel particularly bad about yourself than that you brain is trying to give you a way to improve your status.
I sometimes have thoughts of suicide. That does not mean I would ever come within a mile of committing the act of suicide. But my brain does simulate it; though I do try to always reduce such thoughts.
But what I have noticed is that 'suicide' is triggered in my mind whenever I think of some embarrassing event, real or imagined. Or an event in which I'm obviously a low-status actor. This leads me to think that suicide might be a high-status move, in the sense that its goal is to recover status after some event which caused a big drop in status. Consider the following instances when suicide is often considered: