He went from being wealthy growing up, to being very rich after Paypal, to being an extremely rich billionaire, to being the most richest person in the world (maybe ever?). And now a single utterance of his can shape markets or otherwise influence millions of people.
I think it would be difficult to go through the above and not come out the other end without it impacting your behaviors & world view. At a minimum, before he was this wealthy & influential he didn't have as much margin for error. A single bad decision might have tanked Tesla or SpaceX when they were getting started. It would have required Musk to be a lot more careful & deliberate. He also had to care a bit more (or at least pretend to care) about other people's thoughts/ideas etc. These days he can lose $1B in a twitter acquisition breakup fee and it barely matters. And he has enough "f*ck off" money (the amount required to tell someone to "f*ck off" with no significant consequences) to tell anyone to f*ck off. The need to adhere to social niceties is greatly reduced.
This is all on top of the fact that the average person's behavior is usually going to change at least a little as they get older.
All of which is to say that I think there's an excellent chance that he's grown into his current personality. If so, I think it's very possible that it's a mixture: He grew into where he is now, but the seeds were always there & his track in life has amplified or caused those seeds to take hold.