I hate that I'm having to ask this, because it's been working perfectly fine until now. I use my macbook pro as my home computer and hook it up to an external monitor and keyboard when I'm home. I do disconnect it on occasion. I unplugged it today and when I went to plug it back in and shut the lid, my monitor is saying "no connection." The monitor works fine with the lid open, but I used to be able to close it no problem.
I faced the same issue few days back after being able to successfully close the laptop lid with my external monitor connected all the while. For me it started working back after connecting the power cord to the laptop. Without power, laptop does not seem to mirror the display to the external monitor with the lid closed. hope this helps.
If you want to disable lid sleep regardless if you're on AC or battery, install Insomniac. I use this app all of the time with my mbp, since I don't really like being connected to power all of the time.