My son is 4, and when he was 1, 2, 3, he was the most easy going person!
Then he hit 4, and he was opposite!
Its the age.
3 & 4 years old, is not easy.
They are learning different constructs of life.
Yes, have boundaries and rules, but keep it age appropriate. Otherwise, he will never be able to attain what you 'expect' and you will get frustrated. "Expectations" upon the child, has to be... age-appropriate.
Kids this age, need to have explanations too. Simply stated. So they understand 'deductive' reasoning, which they do not have mastered yet.
It is a learning process.
That is why, they get cantankerous.
Teach him how to communicate, the names for feelings and emotions, and how to express it.
When my son needs to be alone or is irritated, he WILL tell me. I respect that. Then he mellows out and will resume his even keeled disposition.
Because, I taught him 'how'... to manage emotions.
Some adults don't even know that.
A child has to be 'taught' that.
ALSO, when a child is tired or over-tired, they have NO patience! Just like adults. So, he may need to nap.
My son still naps, every afternoon.
He needs it.
Also when hungry, they get like this. They need to graze throughout the day and especially at growth-spurts.
Kids, do not automatically know how... to manage and cope with their emotions. It has to be taught to them.
It is a process.
Not instantaneous.