That's right. This has nothing to do with psychology. It's just a matter recognizing a losing position and playing whatever you can to avoid a certain slow death.
In the MAJORITY of games where I have a losing position, I will start looking for ways to trade material for possible initiative, possible tactical-shots, possible mating attack.
It's got nothing to do with tantrums.
It's just how chess players play chess.
If playing conventional promises a slow, certain, death...
...then something unconventional, daring, sacrificial, and lucky, is the only chance that's left.
Most of the time I end up turning my losing position into a completely losing position, and at that point, I resign.
But as long as there are tricks in the position for my opponent to miss, then I will play on.
Note: "Hoping that my opponent self-mates" and "tricks in the position", are not the same thing.
Chess Etiquette 101: If you have a *completely* losing position, it's impolite not to resign.
It sends the message that although someone was strong enough to make you completely losing, that they're stupid enough to self-mate.
Just resign the game and offer a rematch if you want to play on.