Plugging in external monitor "logs out" (crashes?) user session
If the issue occurred after an update you may have a potential software issue. I understand you have tried a lot of troubleshooting in the comments but I listed the steps that I would follow below.


Make sure you backup all your files first before continuing troubleshooting: https://support.apple.com/en-us/HT201250
Follow this support article from Apple regarding video issues using external displays: https://support.apple.com/en-us/HT201177
As @Stefan suggested, Try reseting SMC.
Shut the machine off. Press Shift-Control-Option on the left side of the built-in keyboard, then press the power button at the same time. Hold these keys and the power button for 10 seconds. Release keys. Power Machine on.
SMC: https://support.apple.com/en-us/HT201295
Try reseting NVRAM: Shut down your Mac, then turn it on and immediately press and hold these four keys together: Option, Command, P, and R. You can release the keys after about 20 seconds, during which your Mac might appear to restart.
On Mac computers that play a startup sound, you can release the keys after the second startup sound. NVRAM: https://support.apple.com/en-us/HT204063
Try booting in Safe Mode as @Allan suggested and see if you can reproduce the issue. Restart machine and hold down the shift key till you see login screen.
Safe Mode: https://support.apple.com/en-us/HT201262
Run diagnostics on your device locally and check for potential hardware issues. Restart machine and hold the "D" key till prompted to run diagnostics. Even if you machine passes the diagnostics, you may still have a hardware issue.
note the Apple Store Genius Bar can run deeper tests on your machine if you schedule an appointment. Diagnostics Mode: https://support.apple.com/en-us/HT202731
If hardware diagnostics passes, you can use Recovery Mode to reinstall the operating system or erase the machine and do a clean install. In recovery mode, if you choose to reinstall the macOS it will preserve the files on your system. You can also perform a clean install from macOS by reformatting the storage drive before installing the macOS. Recovery Mode: https://support.apple.com/en-us/HT204904
You can try updating to the latest macOS. I was having issues using display port and external monitors, updating to High Sierra resolved the issue for me. Update the software on Mac: https://support.apple.com/en-us/HT201541


At the end of the day, the issue you are having is either software or hardware related. By performing a clean install, we eliminate any potential software issues, not factoring in bad display driver code (typically these drivers get updated when you run system updates or upgrade macOS). If the issues continue to happen you may have a hardware issue of some sort either with your MacBook Pro, the displays, or the cables.