This odd behavior mostly shows up when others are criticizing us, disappointed or angry about something we did. Odd because it's so useless.
In those moments, there are already plenty of other people beating you up. Save yourself the trouble.
The rest of the time, when things are going well, it's foolish to stop and engage in self-criticism. It makes more sense to encourage yourself, to bootstrap your way to even more of a ruckus.
So, the moments left to beat yourself up = zero.