Serious parenting help pleaseee

My son is only 4 years old and I know they're still learning emotions and empathy, he recognises when he does something wrong and makes others sad or angry, his got a cousin just a couple weeks apart in age and I've noticed he doesn't accept his wrong doings even though he sees theyre upset, everything has a reason and if there isn't he resorts to "I just want to be happy", "let me be happy" and "I love you" (talking to me) to not get in trouble and get out of apologising, which has never worked btw. I try and talk him through it that it's not as easy as that and talk him through what he did again, no matter how many times or how many different ways I explain he still repeats himself "I just want to be happy, leave me alone", it usually escalates to going to time out but that's when a tantrum starts.

His a super sweet boy and I don't believe I'm biased, everyone compliments how well behaved and sweet he is, his a little cuddle monster, but the problem is he thinks he does no wrong and everything is about him.

What can I do to break through it??

Thought to edit and add that I've been working hard to show him an example, when I mistakenly tell him off or "snap" in frustrating times, I make sure to apologise and validate his feelings, I thought kids learn from example.

Sorry its my son doing this, I wrote this just after he had a fight with his cousin 😅