I broadly agree with the points you've raised here. However, on this one...
My view is at the moment the way to minimise the number of people harmed is to have a judge make the decision.
... I don't. I would have done in the past but I don't think it's that simple. As an example, when the Keira Bell judicial review case initially found that under 16s didn't have the capacity to give informed consent for PBs I was delighted. Then when that got overturned on appeal, I was gutted. It was overturned because the judges ruled that it needed to be a clinical/medical consensus, not a court decision.
Fast forward to now and the clinical/medical consensus (in the Cass Report, supported by the NHS, Tories and Labour) is that there is no evidence base that says they are safe for use in gender dysphoria, therefore their use is banned in this scenario.
During the time between the appeal overturning it and puberty blockers being banned for use to "treat" gender dysphoria, I had a conversation with Stephanie Davies-Arai. I wrote an article that she published on her website and we spoke about it in advance. During the conversation I said to her that I was really upset for both her and Keira Bell (and the children impacted) that "this failed". Stephanie said she didn't see it as failure at all because it was now in the public domain and it was a matter of public record that GIDS was told off for its woeful data keeping. She was looking at the bigger picture - the Interim Cass Report was already out when I spoke to her - and seeing the direction of travel that inevitably followed.
Another recent case in the UK seems to be going a similar way. The judge has ruled that a) a parent who objects needs to be listened to (a key precedent that now applies to any medicalisation of any child) and b) there needs to be a medical consensus on the correct approach for this child:
(NB the thread title incorrectly refers to PBs. The case is about cross-sex hormones.)
https://www.mumsnet.com/talk/womens_rights/5229250-high-court-appeal-by-mother-to-prevent-her-child-being-prescribed-puberty-blockers-privately-on-reaching-16
As much as I wish they would, owing to the poor evidence base, the court hasn't decided that the child shouldn't have cross-sex hormones. It has decided that an objecting parent, who holds parental responsibility, needs to be listened to and that nobody can override this. Not the other parent, the child or anyone else. That's massive. (It logically extends to social transition, beyond schools too e.g. if a parent objects to a social transition that a counsellor does privately with their child: the Cass Report has detrimined that social transition isn't a neutral act, therefore a parent presumably has a legal right to protect their child from this risk). The next step is for clinical consensus on the right outcome for this child. This is a similar kind of victory for safeguarding and common sense, which also acknowledges the limit of the court to make clinical/medical rulings.