Perhaps, for the past 4 years, he was supported and praised in his "Leadership" skills and in how others took direction from him.
But now, his leadership skills have become obnoxious and he is talking back.
But to a little 4 year old, they must wonder why... they are now getting scolded about it, when previously they were complimented on for having "leadership" skills and/or being the leader of his friends and/or how organized he is and at directing other kids and telling them what to do.
Now, his tendency is turning... bossy and bully like.
But generally as you said, he is a good boy and typically very nice.
So the thing is, now he is getting contradictory feedback about his "Leadership" skills. Now it is "bad." Because he is talking back. And he gets angry... when others don't do what HE wants. But when he was younger... it was probably "cute" that he could lead all his little friends and organize them. And he probably got complimented on it.
So basically also, he is used to.... getting his way.
And so now, he cannot handle it... when he does not get his way.
He needs to learn the hard way. Sure, you can guide and teach him as a parent. BUT... he will not get it, unless he is directly affected by it. When his friends, don't want to play with him anymore etc.
And you tell him, he is being "mean."
Use the words with him, that are correct. Don't sugar coat it.
Tell him, he needs to "try his best..." and have him practice with you.
And he needs to learn "coping skills" for his anger and frustrations.
Otherwise, he will grow up to be a frustrated older child. And still be bossy.
I have a sibling that was like that as a child. No one wanted to be her friend. In the beginning, she'd get so many compliments on how "organized" she was and that she had such great "leadership" skills too. But over time and over years of being told that she was such a great "Leader" and organizer and good at telling others what to do... well it just gets to the child's head after awhile. And then, the child "becomes" more that way, but when they are so young and don't have maturity yet, they can become very... very bossy and even Bully like. My Sibling was like that and it took YEARS, of undoing that. Because for so long, she was told she was a good "Leader" and so strong and organized. So then, it got carried away with. Because her strengths became her weakness.
Young kids, cannot handle "power" well, yet. Not even some adults can.
Then when others don't do what they want... they get flustered and cannot handle that. Because, they are so used to others just saying yes to them or going along with them.
Thus, teach your child coping skills for dealing with frustrations. Otherwise he will become an "angry" individual.
All this time, people and friends did what he wanted... and because he was probably praised for being such a 'Leader" and being able to tell other kids what to do and organize them. But now... he can't handle it when others tell him no. Or don't go along with what he wants. He needs to learn, how he is not the boss, of others.
And his anger about it and his leaving other kids out when he does not get his way.... is mean. And you need to be direct with him.
In a sense, he is learning that everyone is different, only now... because all this time he was "allowed" to Boss everyone around. Because it was legitimized by him being called "a Leader" and it was probably a "cute" trait back then. But not any longer. Now he doesn't know how, to be any other way. And that others are tired of him being a "Boss." But previously all this time... he was allowed to do it.