Thank you. So, this is an HP ENVY Inspire 7955e All-in-One Printer. Correct?
This model does not appear in the latest (en-us edition, December 13, 2022) About AirPrint - Apple Support, but it was listed in the July 01, 2022 issue of the same article. AirPrint is also mentioned in the HP specifications for the model.
HP Smart may be needed for setup.
Is the printer connected to a Wi-Fi router (the same router as the Mac)? That is, you should use a connection via a Wi-Fi router (not a direct Wi-Fi connection from Mac to printer).
Is it the distance printer to router, or Mac to router?
At a longer distance, the Wi-Fi signal will become weaker. At some point the connection will not be reliable, and that would affect AirPrint.