The issue you experienced is due to the HP Printer driver being installed on your Mac and the printer was set up to use it. That is common with the HP Printers not printing in color, although the solution is easy. That is why printing from the iPad worked correctly because there are no printer drivers installed on those devices.
Here is what I would have advised if you had not returned it or run into the issue again with an HP Printer. Go to > System Settings > Printers & Scanners, tap on your printer, then choose Remove Printer. Now back to > System Settings > Printers & Scanners, click the button to add a printer. You should see the printer show up in the list and I think it may say Bonjour as the Kind of printer. You can choose to name the printer something different if you wish, then just press Add.
For HP Printers, you usually need to use the HP Smart app to connect the printer to your Internet connection, but that is all you need it for. Once it is connected to the internet, then you just need to add the printer as described above by choosing Add Printer in your Mac settings, selecting it in the window as it will show as an available printer that is connected to your Wifi, then just click the Add button. If you continue on using the HP Smart App, it will continue to download the HP Printer drivers to install on your Mac, and that is not necessary or even wanted.
I have installed several HP Printers on Macs and have ran into the same issue when using the HP Printer Drivers. The printer is AirPrint compatible and that is why printing from your mobile devices worked without a problem. You just need to add the printer to your Mac using AirPrint instead of the HP Drivers.
I have found it easier to use the HP Smart app from a mobile device to get the printer connected to your internet connection and that will get printing working for your mobile devices first and will not prompt to install drivers since the mobile devices do not even allow printer drivers to be installed. Then you do not need to run the HP Smart app on your Mac and can just add the printer on your Mac like recommended above.