This sounds like hardware related issue with the Hard Drive as drive cord is damaged.
I would request you to contact our Support and our Support Engineers should be able to sort this out. HP Support can be reached by clicking on the following link: www.hp.com/contacthp/
Meanwhile, you can try this workaround: Boot the computer from the USB thumb drive and install the operating system
Turn the computer off.
Connect the USB thumb drive.
Connect the AC power adapter, and press the Power button to start the computer and repeatedly press the f9 key to select the Change Boot Device Order option.
Please feel free to contact us here anytime you need any further assistance. Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution