Perform a hard reset (Remove all cables from the AIO, hold the power button in for 30 seconds, reconnect the cables and restart the PC)
If the issue persists, Access the BIOS by tapping on F10 during the restart and if the computer restarts while you are on the BIOS screen, it would confirm a hardware failure and you need to contact HP for hardware service.
However, if it doesn't turn off while you are in BIOS, restart the computer and Tap on F11, to attempt a system restore followed by a system recovery to resolve the issue (follow the screen instructions for details).
Keep us posted,
If you would like to thank us for our efforts to help you,
Give us a virtual high-five by clicking the 'Thumbs Up' icon below, followed by clicking on the "Accept as solution" on this post,