Yes, however school design has pushing what is meant by a room or cubicle for a while. All those photos are from current schools.
Also I would say that it is dangerous to have a room secured from the inside. That implies it can’t be unlocked. All school toilet doors should be able to be unlocked and the doors pulled outwards so you can reach a pupil that has collapsed.
Of course, my argument is that is a retrospective safety measure. Most important is to be able to see that a child is having a medical emergency as soon as possible. Or is being assaulted inside the cubicle.
It is an essential safety measure to have toilet door gaps when a typical secondary school will have at least a dozen pupils with conditions such as diabetes, epilepsy and heart conditions.
That, of course, means single sex toilets with a single sex area beyond the individual cubicle. Like the set of toilets most of us remember.