Sounds for once like social services were being sensible. As I've said before, if your child is too young to sit down and watch a video of a orchiectomy and penile inversion/ double mastectomy, radical hysterectomy, skin graft and phalloplasty, and is too young to discuss the impact this might have on their future sexual function (which basically means prior to age 16), they are too young for you to do anything other than say "dress how you want dear, wear your hair however you want, play with whatever toys you want, take part in whatever sports/hobbies you fancy, and we'll back you 100%, but decisions about being trans are adult decisions."
Looks like that judge watched the dreadful BBC Mermaids-inspired drama and has based his whole understanding on that.