Open Settings.
Click on Bluetooth & devices.
Click the Printers & scanners tab.
Under the “Related settings” section, click the Troubleshoot option.
Select the shared printer with the problem
Click Next to continue.
=====================================
Press Win key+R keys and hit the enter key.
Type firewall.cpl and hit the enter key.
In the Firewall settings, click “Allow an app or feature through Windows Defender Firewall“.
Click “Change settings""
Make sure the “File and Printer Sharing” feature is checked in both the “Public” and “Private” features.
Check both the boxes of the “Network Discovery” feature.
Click OK.