Wow, I have similar issue. I have an acer 4k monitor at home with both HDMI and Display Ports. I used to use HDMI before to connect it to my 15inch 2016 MBP, and the mac used to crash very often. Close the mac, and connect the dongle with hdmi? crash. So I'd have to restart the mac, and connect the monitor while keeping it open, and then close. But once i disconnect the monitor - crash.
I then got a usb c/thunderbolt to display port for 4k 60fps, and the issues significantly dropped, but it still occasionally happens.