Developer Hugo Landau has hacked a train's restroom door [devever.net], based on the model found in the UK's Class 800 train:
Of course, there is a reason for the separation of the closing and locking functions, but not the opening and unlocking functions: it avoids a Denial of Service attack where someone can just press “close” and then jump out before the door closes. If the interior “close” button automatically locked the door, this would result in the toilet becoming permanently inaccessible.
The problem with this design is that most people don't understand state machines, and this design confused a lot of people who were unable to lock the door correctly, or believed they'd locked the door when they hadn't.
The result is a denial of service, being able to lock the door from the inside while no one is actually inside to subsequently unlock the door again.