In my current desk setup, I've got a MacBook Pro plugged into two monitors via HDMI. Every so often, one or both of the monitors will go black for a few seconds. Usually they recover on their own, but sometimes I have to unplug them to bring them back to life.
This was super annoying, but I finally found the fix! The laptop was switching graphics modes in order to conserve power. You can disable this by going to Settings, then Battery, clicking Options, and then turning off Automatic graphics switching.