If you’re talking about someone holding an iPhone to someone’s face, there’s a setting called “attention aware” that verifies your eyes are open and looking at the phone.
https://www.bbc.com/news/articles/c0kl4glp547o (bbc news article about it)
Attention awareness does not stop alarms, and it requires your eyes to be open and looking at the phone.
Attention awareness silences/drasticly reduces the volume of alarms, that's how it is designed.
If they have a bug in the attention awareness feature it stands to reason that it could not require your eyes to be open or looking at the device in question at the time.