Key Lock-in Prevention Function does not Work Properly: Description
WARNING: This page is about a different car, the 2011 Toyota Corolla. However, it is still accessible from the selected car via links, so may be relevant.
When the key is in the ignition key cylinder or the door courtesy switch ON signal is output to the main body ECU (instrument panel junction block), performing the door lock operation with the lock switch does not lock the door.