What happens when a pilot is incapacitated? Is there a contingency for such a situation, where one of the pilots leaves the cockpit, the other pilot is incapacitated (for example losing consciousness) while the first pilot is still outside the cockpit and can not reenter the cockpit. If there is not, is that not a huge flaw, as multiple pilots are meant as a redundancy.

Edit: This is in my opinion not a duplicate of this question, since the big problem in my question is the door to the cockpit being only openable from the outside.

In the linked question, the answer is simply "both pilots being incapacitated at the same time is highly unlikely". The scenario I described is not highly unlikely. One of two pilots being incapacitated is not improbable and the door to the cockpit is only openable from the inside.

So if one pilot is incapacitated while being temporarily alone in the cockpit, the other pilot is "automatically" locked out of the cockpit.
Is there a contingency for such a situation, where one of the pilots leaves the cockpit, the other pilot is incapacitated (for example losing consciousness) while the first pilot is still outside the cockpit and can not reenter the cockpit.


Yes, a keypad on the door will allow the second pilot back into the cockpit. It doesn't help when the pilot outside doesn't know/forgets the code or if the unlock code is denied from inside the cockpit.