This sounds like a problem with the printer itself rather than anything to do with Windows.
From: https://readytodiy.com/hp-printer-wont-boot-up-turn-on-off-0051/
If you tried to shut off your printer and notice that it’s stuck on, your printer is in a “hung” state. The solution for this is simple and will take less than one minute:
- Disconnect the power cord from the printer.
- Unplug the power source from the wall socket.
- Wait 30 seconds.
- Reconnect the cable to the wall outlet.
- Connect the power cord to the printer.
This manual shut down should restore the printer’s functionalities to have it turn off on your orders.
If the problem persists, that means your printer has malfunctioned and needs professional care. Get in touch with the nearest HP service center to find a technician who can diagnose the issue.
You can also try the following:
Does the printer's display panel show an error code (rather than "something is wrong")? If so, enter the code here: https://support.hp.com/us-en/product/hp-officejet-pro-x451-printer-series/5043045/model/5043046
If that doesn't help, see the problem solving checklist at page 141 of your User Manual (available here if you don't have it: http://h10032.www1.hp.com/ctg/Manual/c03640111.pdf)
If still no joy, ask HP Support: https://support.hp.com/us-en/printer