DD was similar, she was a glorious 2 and 3 year old, I (metaphorically) patted myself on the back for raising such a delightful, happy, polite, patient and kind child.
Then she hit 4 - and she went WILD, she was contrary, shouty, argumentative, critical - I still don't know where it came from, we are not a shouty, argumentative or critical family. I find shouting really stressful, so when she shouted, I sometimes shouted in response, just to get the shouting to stop (yeah, I know).
As she's got a little older (she's now 6) - it has improved, but she still has a much shorter temper, and is more critical than either DH or me.
All we can do is model good behaviour, inform her when her tone is inappropriate and request that she re-states what she means in a better way, and when pushed, or if she doesn't listen, implement consequences.
Parenting is brutal sometimes, and I tell myself that she is smart, she is fair, she is loving - and she will learn to moderate her behaviour.