It's happened to me several times: Someone makes a harsh or rude comment, then moments later apologizes but blames it on their personality.
"Sorry I said that thing, I get like that sometimes."
Your reaction to another person, regardless whether they are right or wrong, is not out of your control. No one is perfect, and we all have things we would like to say, but know they are inappropriate or petty.
Stop blaming your "personality" or temperament for how you treat others. It takes practice and discipline, but we should all have civil reactions as our default. Sarcastic, rude and hostile words are a choice.