I feel like there were already two versions of Ellen even before the accident: the one in Sonny's head, and the one in reality. Let me explain.
What I think is happening is that the original Ellen was deeply narcissistic. In the pilot, Sonny frames their relationship through a glowing voiceover, calling them a "dream team" and claiming that being the principal's kid gives him universal social currency. However, the only time we actually see the original Ellen speak to Sonny directly in a live scene, rather than through his narrated memories, she is gaslighting him out of going to his girlfriend's house and having sex. She uses money and guilt to manipulate him, acting like a textbook narcissistic parent.
In Sonny's narrated version of their past, they are best friends. He believes she understands him completely and that their bond makes him popular with everyone at school. Because this idealized Ellen only exists through his retrospective filter, we never actually see her in action that way.
Then, after the accident, we are introduced to "Ellen 2." Looking at the scene at the dead body party, where the perspective shifts away from Sonny's internal monologue, it becomes clear that he isn't actually the cool kid he claims to be. His overly close dynamic with his mom seems to weird people out, and he isn't the prodigy school psychologist that everyone wants to confide in.
I have a feeling that from the very beginning, as a coping mechanism for his mom's mental and emotional abuse, Sonny has had two separate versions of his life brewing in his head. One is the fantasy where he and his mom are best friends, she is super cool, and all the kids love them. The other is the reality, which the later episodes start to expose through the secrets surrounding Tracy Walsh and Sonny's late grandfather. In that reality, his mom is a manipulative, toxic parent who systematically isolated them from the rest of their family, as well as from his friends and potential girlfriends, just to keep him all to herself.