Boy... I wish I knew what the answer is here.

It seems like I put my foot in my mouth, as the saying goes, multiple times every day!

As soon as I say something I know it was the wrong thing to say.

Often I know it even before I say it. But do you think I can stop myself from saying it? No!
From what you wrote, it sounds like you're doing a good job of owning your problem & doing as much as possible to make amends. But I understand what you want is to not have these outbursts to begin with.
The Buddhist nun Pema Chödrön writes about learning to allow some space to occur between when someone says something to us & when we reply. Often, she writes, if one can just wait a few seconds before speaking, that brief interlude can create an opportunity of us to react in new ways & avoid simply popping off like we have typically done. This is what I try to do. But it can be devilishly difficult to do in real life.