I have an alarm clock app that disables the power button when alarming (to prevent from turning off the phone). This option works fine on my ancient android phone, but it doesn't work somehow on Honor8a (Android 9).
If it could be working that would be perfect. But if it's impossible with android 9, I look for an opportunity to disable the power button (the restarting and the turning off options) permanently. But I need to save the locking on option though.