YANBU - and I know how you feel!
My DH has acted in a very similar way on many occaisons. We have a DD (10) and a DS(3.5).
What I learnt after many frustrating episodes, is that, if he has something on his mind, or if he is stressed, that is when that type of behaviour emerges and he can be horrid. Sarcastic to DCs and hyper sensitive to the slightest hint of criticism from me.
If he was in that kind of mood, there was absolutely no point in trying to get him to see what he was doing. It just made things 10 times worse and caused huge rows.
What I discovered was that I could talk to him about it the next day, giving him examples of things he said that were upsetting. In a fresh light, he could see that he had been unreasonable and was upset with himself.
Over time, I am glad to say things have improved. He is like this much less often, infact rarely and he can see when he is getting like it and will make a huge effort to calm down or remove himself from the situation. He has also found it helps to have a chat to DD when he is stressed, he explains that he is busy at work and tells her it is HIM who is in the wrong not her.
I was also careful to acknowledge my own parenting deficiencies (and there are several!) and not to be too critical - only brought it up if it was really bad.
I have come to gain a huge amount of respect for him for the way he has acknowledged he has been in the wrong and has tried hard to change.
I don't know how old your DH is but my DH often feels he is too old to be Dad to a toddler - he is only 44 ffs! His own Dad died aged 80+ when DH was a teenager and I think this has had a profound effect of his confidence as a father. I have spent a lot of time reassuring him that he is a good Dad and that the DCs love him to bits.
I hope my "story" will give you some hope - I know it was hard to put up with but all the effort from both of us was totally worth it - I can honestly say that we are all alot happier!