Main monitor goes black when using external monitor on MacBook Pro This problem happens occasionally frequently with my Macbook Pro. When I plug in one or more external monitors, the main monitor goes black. When I try Detect Displays it does not register the monitor. I assume that this is something to do with a docking port or something like that, but I have no idea how to fix it.

This started occasionally, but now it is happening relatively frequently. Generally, it will either happen within 5 min. of (first) boot or it won't happen at all. Sometimes it does not recur after rebooting.
If this is an occasional event - it's often just that the signalling didn't work between the GPU detecting the monitor or the monitor reacting to the input.

Something that never ever works or that you can reproduce at will (or perhaps statistically one time in 10) makes it easier to troubleshoot. From your description, it's hard to tell if it's a normal thing where the pairing isn't always perfect or if indeed something could be made better in the software / hardware / connection.

Since its happening regularly, you will want to have a piece of paper or equivalent to log to the second when it happens and just note what you were doing when you notice the black screen. After 10 to 20 log entries, usually a pattern arises and you can also look over the diagnostic logs with the console app to see if there are messages indicating why the gpu is not working normally. 

These logs will be invaluable if you want to seek support from either the monitor vendor or Apple. If the logic board or GPU are failing, this will get worse rapidly, so if it remains more or less steady, then you'll want to try isolating software if possible as a good next step to troubleshoot this.