These replies make me wonder if the posters actually have a child in secondary school. Even teachers are in the media about schools, saying they are not fit for purpose, that schools are now failing children.
My children's secondary school are the same. They will not allow children to go to the toilet during lessons. They also have specific toilets to use at break times only. That may mean that the toilet is in a different building so getting there, waiting to use 6 toilets between 60 children and getting back takes up more than their break time.
I have also told my children the same after a very similar situation to you, however my son phoned me during class where the teacher could hear him and told me that they were refusing to let him go and he was going to have an accident. He unfortunately didn't make it to the toilet in time.
This is a school where blazers must be worn regardless of heat, therefore children are drinking more and needing to use the toilet more. Emails are sent home regarding hydration and children should be taking water bottles to school to ensure they are hydrated and helping their brain to concentrate. However they're not allowed to use the toilets, but must drink plenty.
As for adults and work. If I need the toilet, I excuse myself and go! Another adult, regardless of what the meeting was about etc, would not get pissed off because a co worker needed a wee.
Ridiculous, clueless replies. You are not being unreasonable.