I had the max classroom size limit issue at the start of year 11 because somehow through people processing subjects, they misinterpreted modern history to be ancient. To switch to my original lines (there was only one option with all my subs in diff. lines) I had to switch into 3 full classes and change 5 classes. My deputy back then, didn't exactly tell me the way around this until like legit a week before he left, in which case, I didn't bother with changing 5 classes, instead only changing 2 (one was an already full class)
Basically apparently, there's a legal limit of somewhere in the 20s. it's either 23, 24 or 25 (or somewhere along those lines) Any students who wish to enter a class after the legal limit, must get permission from the teacher first. If the teacher agrees - then the student is able to enrol into the class, if not, then bad luck.
That's what I was told anyways
Hoped it helped