No, you do not need to unplug the Ethernet cable. But you do need to ensure your desktop's Wi-Fi is turned on.
Even though your internet comes through the Ethernet cable, the HP Smart software needs the computer's Wi-Fi radio active to communicate with the printer during setup. Go to your computer's network settings and turn Wi-Fi on. You can be connected to both Ethernet and Wi-Fi simultaneously for this process.
Proceed with the HP Smart installation and setup. The software will use the Wi-Fi connection to find the printer on your network.
If that didn't work: If Wi-Fi is on and it still fails, check for VPN software running on your desktop. Disconnect any VPN before running HP Smart setup.
Heads up: After setup, you can turn the computer's Wi-Fi back off if you want, as printing will occur over your home network.