The door lock switch in the A320 has 3 positions:
UNLOCK - obvious
NORM - door can only be opened using the correct code/procedure, known by both pilots and a senior FA
LOCK - door can’t be opened at all for a preset time of 5 to 20 minutes.
Switch is normally in NORM during flight, allowing only authorized people with the code to get in.
LOCK is only to prevent a hostage situation where a hijacker would force a crew member to reveal the door code. LOCK position thwarts this.
Under normal circumstances, a heart attack would not prevent cockpit access. The switch would be in NORM, and the door can be opened.
So, this was not normal.
And, presumably, a heart attack doesn’t immediately re-program the course of flight into a steep descent. A heart attack or a door switch in the wrong position are both low probability events; together they are extremely low probability. To be coupled with the steep descent verges on the mathematically impossible.