Greetings,
Welcome to the forum.
I am not a HP employee.
Have you changed any power management settings?
This symptom can be caused by changing these settings, older component drivers, or you may need a BIOS update. It is also possible you have a motherboard hardware problem. One last wild card causing this problem could be updating to Windows version 1903 since purchase.
I would go here (Link) to install the latest 2019 drivers for your PC. You can get the latest BIOS update for your PC at this (Link). Be patient when installing a BIOS update. Loss of AC power or shutting down the system during the update will break the PC.
I would either: contact HP Support (which can be done at the above links) if the updates fail to fix this problem, or return the PC for an exchange/refund if possible.
Regards