I think it's humility, / empathy or accountability I am talking about. Basically my nearly 5yo boy has a tendency to get quite stubborn when ever he does something accidental to someone else. For example, the other day he accidentally bumped into our friends 2yo daughter and she fell over. It was nothing serious, she was fine, and it was an accident which happened whilst he was playing catch with his Dad, but we went over to the girl and her Mum to se if she was okay and to apologise etc, however my son refused to say anything and just walked off, saying it wasn't his fault and got really cross and stubborn.
To be clear we weren't telling him off or scolding him at all, but encouraged him to check the little girl was alright and just say sorry for bumping into her whilst we were acknowledging it was a complete accident. These are the types of situations he finds hard and he really digs his heels in.
Also, similarly if, say, someone accidentally slightly hurt him / trod on his toe or similar, he will get cross and say "you did it on purpose" and sometimes hits them back, even when the person immediately says "oops, I'm ever so sorry etc". We obviously have conversations about this but he is very much entrenched in this phase. He is our only child so I don't know if all children are like this.
I don't know if this is completely normal at almost 5, or if there is anything further we can do to support him apart from the conversations we have been having, and of course modelling.