My android phone used to spontaneously reboot once a month or so and since it was encrypted, it wouldn't finish booting until I entered my unlock code, so the alarm would not go off. I haven't had that problem in a year or more plus now I think even an encrypted device will boot up enough to make the alarm work (though I'm not certain).
Also, about once a month or so, I either forget to plug my phone in or don't get the cord plugged in all the way and I wake up to a dead phone.
A standalone alarm clock (battery operated or with battery backup) is much more reliable.
Though nowadays when I need to get up on time (like to catch an early flight), I set an alarm on a second device, either my wife's phone or a tablet but if I didn't have that option, I'd use an alarm block as backup.
My daily driver, Sony Ericsson ELM, rings an alarm each morning I need it, for the last ~9 years. Even when it's off, even if the battery is dead (once had a problem with a charger, couldn't even boot the phone, but it rang each morning for a week).
My iPhone? If it dies, it dies. Not even talking about Android.
Read the box or documentation carefully before buying, though, because sometimes the functionality is greatly reduced when running on the backup battery. Mine, for example, stops displaying the time when on backup, and I think alarms will not go off. The backup is just to save you having to set the time and alarms when power comes back.
For those times I really need to wake up on time, even if power has gone out in the night and is still out in the morning, I use an old fashioned Westclox Baby Ben wind-up clock that I've had for 40 years [1].
[1] https://clockhistory.com/0/westclox/series/series-14-1/style...
Back when I was doing hourly shift-work and I absolutely had to be to work on-time, I used a battery operated travel alarm clock like this:
https://www.amazon.com/Casio-PQ15-1K-Travel-Alarm-Thermomete...
The AAA battery lasted a long time (like a year or more).
But after you overslept and unlocked your phone it actually sounded the alarm, regardless how much time has passed.
Also, a standalone alarm clock won't automatically switch to daylight saving time... on the year daylight saving time was finally discontinued. Happened to many people a few weeks ago (at least the daylight saving time switch, like the federal/state/municipal elections, is always on a Sunday).
[1] https://www.lumie.com/products/bodyclock-starter-30-refurbis...