Inkjet printers do not like being left sitting unused for extended periods. This is not a problem that is specific to this model, or even to HP inkjets. It is a feature of pretty much *all* inkjets. The ink eventually dries out in the print head, and clogs the nozzles.
Since this is an HP, replacing the ink cartridges will probably help. Unlike other vendors, HP integrates the nozzles into the cartridges, so you are effectively replacing the print head when you replace the cartridges. But if you leave it sit unused for 5 months after installing the new cartridges, chances are it will be messed up again.
If the world isn't making sense to you, you're either drinking too much or not drinking enough.