Disable power button when alarm goes off

Hi, I have a Galaxy S9 and I have developed the habit of restarting the phone when the alarm goes off. Can you disable power off until the alarm is dismissed (e.g. via QR code)?

This feature was apparently available before

but does not work on my Galaxy S9.

Thanks!