If it’s a coping mechanism, actively practicing a different (less harmful) coping mechanism will eventually cause your brain to shift away! The classic for this specific one is to say something sarcastically positive about yourself, but there are definitely others that you can look into! (It does take a lot of practice but I believe in you)
Im gonna be honest, while its nice you apologized i really dont think you should feel anyway about it. It was a joke about yourself not aimed at them, just cause they got offended about their own insecurities shouldnt make you feel anyway. Its just like boundaries, you can’t force them on someone else. You can have them for things you won’t stand for but no one can make you not do this thing because they don’t like it🤷🏼♂️ But i also am done caring about others and their feelings sooo idk