&gt; I don't think I've been very kind to myself these past few days 

From what I've read in your post/comments, this is literally the only thing you're doing wrong. 

It's not healthy or sensible to blame yourself when someone else acts like an arsehole. You don't need to feel embarrassed about someone else's actions towards you. You sound like a strong, capable, responsible person, so don't sell yourself short in this way. 

Obviously your reaction is also a perfectly natural one, I'm not saying it's abnormal to feel this way - we all have moments of "what did I do wrong? What could I have done differently? Christ, I'm such an idiot" when stuff like this happens. But it's important to remind yourself that the answers to those are "I didn't do anything wrong, I shouldn't have done anything differently, he's the idiot not me". Make it your mantra if you need to. So that when you see him you don't feel silly or scared or embarrassed, you can just confidently say "wow you're an idiot" and walk straight on by.