Heart attacks can bring on a sense of panic and fear. Your friend was gone for 20 minutes, then brought back. It would help to know the following:
Did your friend suffer severe pain?
Was he resussitated in hospital or outside?
Heart attacks can be very similar to having a bang on the head or being unconsious after an accident. Your friend can't remember being dead because he was not really dead, yet. He was unconsious, and they brought him back because there was a chance. If he was fully dead, they would've given up.
Also your friend could've been experiencing a darkness or void NDE that some people experience. This is when they experience "nothing" but darkness.
https://www.near-death.com/science/research/void.html
I just want to quickly mention that some people don't remember anything while briefly "dead" and this doesn't mean there isn't anything.