I have a Retina Macbook and macOS Sierra but the symptoms are the same as described in this post almost 10 years ago: https://discussions.apple.com/thread/822656?tstart=0
I am using external display and keep MacBook closed. However when I unplug the display and later open the lid it either thinks that it is still connected or just hangs up.
One would think there were some advancements in 10 years, but apparently nothing changed. Is there anything I can do?
I use Macbook Retina Mid 2013 with different displays and adapters, normally I have 1 or 2 different displays plugged in using two Display Ports depending on whwere I am working at the moment.
UPDATE Now I have a Macbook Pro 15" 2016 with Touchbar and dedicated video card and it's even worse. So I guess it's just a fact of life let's see if High Sierra changes anything.
Best Answer
It appears a SMC reset will fix your issue. I just answered another question pertaining to display issues. I've included the same information directly from Apple as I did with the last question.
Have you tried resetting the SMC (System Management Controller)?
With charger plugged in, hold Shift-Control-Option on the left side of the keyboard, then press the Power.
Source: https://support.apple.com/kb/HT201295