It is impossible for the remaining pilot, if incapacitated, that the outside pilot could not get in. There is a fail safe. This has to be intentional,
"The door can easily be opened from the outside without ANY action whatsoever from the inside. It's specificially designed this way of course for the incap situation.
"I have flown the A320 for three separate UK operators. NONE of these required a member of Cabin Crew present in the Flight Deck when a pilot leaves for physiological reasons. What would be the point? The ONLY case that requires a member of Cabin Crew to be present is when the CCTV is broken and hence a second pair of eyes is needed to look through the peep hole to verify entry when the other pilot is returning from his toilet break allowing the remaining pilot to stay in his seat flying the aircraft and monitoring the radio at all times."
pprune.org