What a shamefully transphobic thing for you to write. You are dead wrong about that. The school should have respected the child's privacy. The school should have protected the child if the child believed that their parents would be unsupportive.
Any assertion to the contrary does not respect the human rights of the child, their human dignity, or their well-being.
Shame on you for writing such a horrible thing.