It shouldn't be possible to get locked in on a class 185 unit. If the system decides the toilet needs to be placed out of use, it should allow anyone inside to leave first, then lock the door, so your experience suggests a fault with the system.
Using the emergency alarm if you do find...