Connection Problem with HP Pavilion Monitor and 2015 MacBook Pro Retina
I agree with HP - an incompatible resolution could certainly cause this problem, although it could be something else.

The recommended resolution for the HP Pavilion 22cwa 21.5-inch IPS LED Backlit Monitor you purchased is 1920 x 1080 pixels, so you could certainly play around with your settings in Apple > System Preferences > Displays to see what impact they have.

The other thing you can check are the various settings on the monitor itself by pressing the Menu button to access the On-Screen Display (OSD). One option that I've seen help many users is changing the Input settings on their monitors, such as turning the automatic input setting off and manually selecting the input.

If all of the above fails, there are some troubleshooting steps you can try on your MBP.

Reset the NVRAM

Older Macs had what's called Parameter RAM (PRAM), newer Macs use Non-Volatile Random-Access Memory (NVRAM). To reset this on your particular MBP, follow these steps:


Shut down your machine. Yes, a full shut down, not just logging out.
Press the power button and then press the commandoptionpr keys. You have to make sure you press these keys before the gray screen appears or it won’t work.
Hold those keys down until your Mac reboots again (i.e. you hear the startup chime a 2nd time).
Let go of the keys and let your Mac reboot normally.


Note: When you log back in you may need to readjust some of your system preferences (e.g. speaker volume, screen resolution, startup disk selection, time zone information, etc).

Boot into Safe Mode

Follow these steps to boot your Mac into Safe Mode:


Fully shut down your Mac
Restart your Mac
Immediately press the Shift key and keep it down 
Let go of the Shift key when you see the login window (NOTE: If you have FileVault enabled you may need to log in twice).
Take a note of what happens (i.e. can you connect to the monitor okay, etc)
Restart your Mac as normal to exit Safe Mode
Test again to see what happens


Once you've booted into Safe Mode, let me know how you went and we'll go from there.