the printer is hard connected to the desktop
I am guessing that as you have the printer connected (via a USB cable) to your desktop, the printer "is being informed" once the desktop sleeps/is shut down and goes to eco mode/goes to sleep too.
Why not just make the printer available over WiFi for both machines - without wiring it to one or the other?
The message from the screenshot you provided reads that if you choose to share the printer it will not be available while computer sleeps. Maybe disable sharing so that the printer, once connected to your WiFi is available to any computer connected to your WiFi.