Hi,
Most probably recovery partition got corrupted with that immediate shut down on installation process.
It'll be better if you can rule out any hard drive failure by performing extensive hard drive and memory tests from System Diagnostics UEFI, by tapping F2 or ESC key as soon as you power on laptop. Let it finish.
Have you created HP Recovery USB using HP Recovery Manager just after initial setup of this notebook after you bought it? You can use this recovery media to factory reset after System Diagnostics tests passed.
Otherwise If hard drive tests PASSED,
You have 2 options:
Order HP Recovery USB directly from HP support specific for your model and use this to factory reset
Else do a clean install of Windows 10 Home 64 bit, by creating UEFI bootable Windows installation USB using Microsoft windows media creation tool.
https://www.tenforums.com/tutorials/1950-clean-install-windows-10-a.htmlWindows will be automatically activated after installation while connected to internet
Regards
Visruth