Awwe sweetheart, I’m so sorry you’re going through this. You sound absolutely worn down and heartbroken, and that in itself tells me how much you love your DS.
Firstly, children don’t become “different children” for no reason. Behaviour is communication there is a reason for every behavipir.
If he’s masking at school and exploding at home, that often means home is his safe place. It doesn’t feel like it when you’re being hit or told “I hate you”, but sometimes we get the fallout because we’re the secure attachment. I can tell you this from experience
Year 2 is a massive jump in expectations, they are getting ready for yr 3. More sitting, more writing, more social pressure. If ADHD or ASD is in the mix, the increased cognitive and sensory load can tip things over. Quiet at school anf meltdowns at home is very common in neurodivergent children.
It could be emotional processing around spending more time with his dad. Even if he loves him, children pick up on dynamics and tension far more than we realise. Big feelings tend to come in messy ways. Is it at possible that exH is speaking about you in a way that he really shouldn't. That can unfortunately happen.
You’re not failing, you’re responding. You’re limiting screens, doing 1:1 time, working with school. That’s exactly what a good parent does.
Personally I would push for referral/assessment if you suspect ADHD/ASD, get intervention as early as possible. Ask school specifically how much he’s “holding it together”. Are there situations others, or DS would normally respond different to. Masking is exhausting, for children, I've been through it with my DD. When he says hurtful things, think of it as dysregulation rather than truth. Regulated brains don’t shout “I hate you”
Make sure you have support. Crying every night is a sign you need someone holding you up as well.
This may be a phase, it may be ND, it may be stress, it may be a combination. But it isn’t the end of your lovely little boy. He’s still there, he’s just overwhelmed.