Could it be undiagnosed ND or autism? Combined with male privilege it can be a toxic combination. If he's lost his work routine this may pretty much be your life going forward.
If you're walking off, and have explained you feel embarrassed, and he isn't even acknowledging this, and is making it all about HIM....
How long have you known him?
I have traits myself/tend to notice the details of things. Especially when I'm anxious I have a tendency to talk shit.
As a petite, single, low-status woman, if I mouth off my opinions at people in public I will get completely ostracised/ignored/attacked. Or I'll get kicked out of friendship groups. So I don't.
As an older man with a successful career and a wife, so a certain amount of status, "correcting" people probably doesn't get a negative reaction as much.
Not sure its going to get any better unfortunately.
I've seen older men (my late father, sadly, included) where they get so worked up/anxious/obsessive over irrelevant things that they really are better off solo. For everyone's peace of mind.
There's guys at my workplace who have to come back/refuse to retire as they are so "difficult" that they have to be somewhere they can follow new people around and correct them. Wives refuse to have them at home.
They're normal looking, good salaries, have everything going for them on paper. Pretty much the ideal bachelor for someone looking for a husband.
But there's that tendency to get into other people's space/randomly give aggressive lectures/word salads on things that are nothing to do with them.