I just ran into this issue. it is in fact maybe a motherboard issue. Note if your out of warranty they your best bet is to do it yourself if your tech savvy.
First I recommend to replace the CMOS battery which you can get one from a rite aid etc. Now bare in mind that once you replace the battery and you go through all the steps below this paragraph, then later the information is lost a again meaning you get that serial error then you can determined that the motherboard is really bad.
Second copy down the:
S/N: maybe on sticker at bottom
P/N: maybe on sticker at bottom
Model# maybe on sticker at bottom
PCID which is located under the battery via white sticker
Next what you want to do is to re-write these to the bios. go to the page below and download the Rufus software to create a bootable USB drive. Also you will need to download the file "HP DMI"
All the links to these files can be found here : https://www.geekslab.it/hp-serial-number-not-found-fix-solution/?lang=en and there is a readable instructions on what to do but I recommend using the you tube video link once you have prepared the USB.
Once you have prepared the USB, go to the you tube link below
https://www.youtube.com/watch?v=27ovRbvZW64
and follow this step by step via the YouTube video link below