I have the same problem of not being able to boot up with and SSD but boots fine with HDD.
I bought a Samsung 870 QVO 1T to upgrade from my WD 1T HDD. I cloned the drive and when I try to boot it will hang on the HP logo and if any keys are hit, it will go to a system info screen and no further. I also tried it formatted with just a drive letter but same result
Suggested from HP, I upgraded or flashed the BIOS to
HP Consumer Desktop PC BIOS Update (ROM Family SSD 81B4 F.41 Rev.A
There was no change after this upgrade?
There is one odd thing after the upgrade, when I boot, I get a Windows 10 logo and not the HP logo.
I do not see buying a different, older, smaller, slower SSD to make this work is a solution