When Kate returned to the apartment at 10pm & discovered Madeleine was missing she did not venture outside the front door, merely looked out the window. One explanation for that is the door was double-locked & Gerry had the key with him in the Tapas Bar.
I find it difficult to believe that the parents left the key in the apartment during dinner because, in the event of the patio door jamming or being locked by a mischievous child, they'd have been in a bit of a bother.
Locks requiring a key to get out are a fire hazard and are therefore rare. The key wasn't needed to get out of 5A , just to get in imo. Here's Matthew's clear and concise description of how the door worked (not);
There was a lock, erm, it sort of, you know, one of those you turn twice with the key. And I think, and sort of I think a round, or was it like a lever handle, I can't remember what the handle was like, I think you had to turn it to go in and so it would snip, erm, you couldn't really shut it with the lock on, but I think if you didn't lock it up here you could then just open it and shut it, I think you had to actually lock it to, it wasn't like a Yale thing that, erm, stops you opening it again, I think'.
http://www.mccannpjfiles.co.uk/PJ/MATTHEW-OLDFIELD-ROGATORY.htm