OP I'm so sorry for all that has happened. I don't believe in karma but I do firmly believe that life has a way of working out ok, despite the challenges thrown our way.
I'm the grandparent of a child whose mother presents extremely well in court, whilst being a heavy cannabis user and a somewhat neglectful parent. If you met her you'd come away thinking what a lovely person she is.
My son has access and we as a family do our best to be the stability in DGSs life. He's an intelligent child and at 9 years old, is starting to figure things out for himself.
We never ever say anything negative about his mum. We just provide structure, have a regular bedtime, feed him homemade meals, take him on little adventures etc. As a result he loves seeing his dad and feels safe enough with him and us to tell us about stuff going on at home (we don't ask). While his mum isn't abusive, I'd describe her parenting as benign neglect. So he's clean and fed, he (mostly) attends school.
My advice to you is to document everything. Make notes. Do all communication via text or email. Grey rock his family. Make your own life as good as possible so as your DC grows, they'll know what a good calm loving home feels like. And will make choices based on that. Obviously if you have evidence of actual abuse or dangerous neglect then go straight back to court.
In terms of Karma, the karma in this case is that, if your ex is bothered to maintain contact (and I'd bet he won't!) your DC will eventually realise exactly what his father and his family are like.
You'll be fine, you're a good loving mum, children grow so fast. It seems like only yesterday since my son was in utter despair after the first court case. They've been back and forth to court a few times since as circumstances change, and some judges can be very biased. But my son has learned to be very clear in court and to take very precise notes of what each judge has said. Good luck OP.