You must address the dressing down you get - and it is that. You deserve to be treated the way you let people treat you. My W would "keep on going" however so if you have this I can sympathise/empathise and any other "thise" you wish to have...
I can give you two situations:
1.Your W asked if everything is okay. This is a pre-cursor to can I help you with this? You can even engineer that e.g if she says is everything okay, you can say yes I think I could do with a little help with something. Then talk her through how you feel about this, how she makes you feel. Help her see that you need to be supportive of one another in front of the kids. Not contradict or show disrespect etc. Then ask her if she can refrain from it.
2.If you W is like mine, she will justify what she is doing. Yes but I am ding this because...therefore I don't feel the need to change. Or worse you might say "Honey I have got this...." and she might contradict you and keep on going. If you W is like this (like mine) the dressing down continues because you let it. I did lots.
My kids felt W ruled the roost and even now say, you had better check with M. I now tell them, sorry kids, D says what goes and M will be happy with it as I am making this decision. M kids defiantly saw the disrespect and there were hints at them mirroring it. I had to stamp that out be being uber authoritative, and then undo my W's disrespect. I am still doing this in fairness as its not fully gone. So she get the phone put down if she spews and if she speaks in appropriately she will get anything from "Don't speak to me like that, who do you think you are, no body speaks to me like that, nobody. Do you understand?" It is very rare that I would be so forceful but I do and will if I need to (out of earshot of the kids because it is flipping into her state in terms of TA - Adult/Teacher). Note often I will say something like "That attitude won't get you what you want. I think you need to set a better example." It's tricky and others may chime in hopefully but boundaries need to be that rather than raising the stakes and making things inflammatory and if you have a WW on a hair trigger its dangerous. The boundaries cheat sheets are good though and there's plenty online. There's also the 'when you say take it sounds like you feel that......' could try that as it can take their eye off what is going on and make them think about their feelings and your. They sometimes get stuck on a loop.
In terms of the whole sitch. you described pre-gym. Stay in the gym longer is my advice. I suspect you started the whole sitch. off to some degree. I used to do this. I would come home at times like a 'grump' not always by any means. I got to a stage where I would stand outside the door and say to myself - how is the perfect Dad and H going to be when he walks in this door today. That helped. But de-stressing is important. Try a mindfulness app. They are free and really help.
Good luck chap!
Surfer.
M46/W40/D8/S6/T20/M12/Separated 6/2016,W takes kids Issues2009 Wpartying w/g.f's2013on EA2013PAdeniedWleavesMBR ImeetAP/EAhalts VariousBDDates MFCourse WSpew EAresumes I halt Wrages DBIng4/2016