Thanks to Knud Larsen for sharing the resource.
I guess the problem was with the manual install of hlip-3.21.4 package from the HP support page.
After running:
sudo apt-get install hplip
and:
sudo hp-setup
the first time nothing happened. I had the same error:
no printer detected
The second time I have issued the command sudo hp-setup, the printer was finally detected!
At this point there was another issue: the automatic command (hp-plugin) to download the plugin did not work.
I have solved the problem following the discussion in this question in Ask Ubuntu: HPLIP Driver install fails on Ubuntu 20.04
Although I already had hplip-3.21.4.run installed in my system, I manually downloaded the latest script from the HPLIP website and ran:
sh hplip-3.21.4-plugin.run
Finally the printer was successfully installed.