I have tried just about everything, including upgrading from Windows 10 to 11. This fixed the problem for several weeks, but now it's back. I suspect an update broke it again. In my case it happens regardless of wifi or USB, and I cannot connect my printer up to my desktop via USB because it's in another room.
I have no idea why this is such a nagging problem across the board.