HP 5.1.1 Printer Software Update - Apple Support
Earlier, an HP LaserJet P1005 (1.6.1) driver from the above package appears to have been used (the linked old information list about supported printer models can now only be found via an Internet archive service). However, the package in question is Not compatible with macOS v12 and newer. The problem seems to be that the installation is prevented under newer macOS versions, while the underlying driver as such possibly is OK. Some package modifications have been suggested, but the success rate is unclear.
An HP LaserJet P1005 Linux driver is available elsewhere.
https://developers.hp.com/hp-linux-imaging-and-printing/supported_devices/index
If nothing else helps, you may want to investigate whether a small and relatively inexpensive Linux-based Raspberry Pi print server and CUPS could make a USB-connected HP LaserJet P1005 act as if it were an AirPrint printer, in order to allow network printing from a modern Mac or iPhone/iPad (an AirPrint printer can be used without additional drivers/software). Look upon this as an experiment.
More about how to set up such a Raspberry Pi print server can be found in the posts by Techguyuk in Can’t print with iPadOS17 - Apple Community. Tesserax mentioned a Raspberry Pi 3 Model B+ in Can I connect my laser printer to my netw… - Apple Community.