If you have a Dual-band router and both 2.4GHz and 5GHz networks share the same name/SSID, then the printer will not be able to connect to the network. In this case, contact your Internet service provider to assign different names to both the networks.
First uninstall the printer software from root level once again and then install the Windows Native Driver
1.) In Windows, search for and open Programs and features
2.) Select your HP Printer
3.) Select Uninstall
4.) In Windows, search for and open Devices and printers
5.) In the Devices and Printers windows look for your HP printer. If you see it listed right-click on it and choose ‘Delete’ or ‘Remove Device’
6.) Open up the run command with the “Windows key + R” key combo.
7.) Type printui.exe /s and click Ok. (Note: there is a space in between “printui.exe” and “/s”)
8.) Click on the “Drivers” tab
9.) Look for HP Printer driver. If you see it Click on it and click Remove at the bottom
10.) Select Ok
11.) Select Apply and Ok on the Print Server Properties windows
12.) Close Devices and Printers
13.) Restart the computer and reinstall the printer driver using the Windows Built In driver and follow the onscreen Instructions