This printer?
http://h10032.www1.hp.com/ctg/Manual/c05200561.pdf
To be sure that I understand the configuration:
The HP M2227 is connected via USB to Windows 11 Laptop A and configured as a shared device.
The printer functions normally on Laptop A.
However, Laptop B cannot B cannot see the shared printer on the network, Is that correct?
Are any other computers on the network able to see and print to Laptop A's shared printer.
What IP address did you use for the printer?
= = = =
My thought is that there is a configuration issue related to how the printer is setup: either as a network device or as a shared device.
Are you able to use Ethernet to connect the HP M2227 to the router?
Configuring the printer as a shared printer places a dependency on having Laptop A turned on and online before any other computers can use the printer.
As a network device, connected directly to the network, there is no dependency on having Laptop A or any other computer hosting the shared printer turned on.
Reference physically numbered Page 114 in the User Manual to check the printer's configuration.