Thus it does no good, and did no good, in this case.
Can the cockpit door be opened from the inside, regardless of the override?
If so, then the second person in the cockpit (the one not bent on murder-suicide) could open the door for the locked-out pilot, could he/she not?
Unless the second person in the cockpit is the 102 lb. stewardess (Kirstin), whom the psychopathic pilot has immediately knocked out with a right hook as soon as the door has locked behind the restroom bound good guy pilot.
The second person could open the door if they are not taken out by the co-pilot first.
It is not foolproof.