It seemed that the teacher reported it to the administrators, and the administrators made the mistake of contacting the girl's guardian. The administrators were plain stupid, and maybe lazy; hard to say if the teacher should have done something differently -- I guess it depends upon the local law.
As far as the judge, it seems, very simply, to be a case of gross negligence on his part. He should be tried as an accessory to the rape crime for this. That might even apply to the school administrators.
In general, I can't imagine the horror that this poor girl went through, being told that she must return to an unsafe home, and, as a minor, having no rights to do otherwise. Such betrayal, on so many levels.