MBP Retina 15 inch, late 2013 shuts down randomly I have a MacBook Pro (Retina, 15-inch, Late 2013) with: 2 GHz Intel Core i7, Intel Iris Pro 1536 MB. I use it mainly with my Henge Docks vertical docking station and Dell 25-inch UHD monitor with external Apple keyboard. In this setup it works perfectly well. However…

Yesterday, when I have taken my MBP out of the docking station and tried to work just on the notebook without any additional devices attached, it shut down after about 30 mins. No warning message, nothing. Nothing in the system log either - only the BOOT_TIME information after the restart.

In the evening (working from home - no peripherals - just the power adapter) I have experienced another shutdown and then decided to install latest El Capitan patch. After that I have run the built-in diagnostics - no errors found.

I tried to work but there were two more shut downs. After that I did reset the SMC and PRAM, but it did not solve my problem.

Today at work - working with a docking station - computer was stable as rock. No restart - nothing. But when I came home it shut down after about 40-50 mins and then about every 20-30 mins. I have no clue how it can work perfectly well with the lid closed but shuts down without any peripherals attached but with the lid open.

Any clues/hints? I am stuck and desperate (warranty ended long time ago).

Additional info:


Using WiFi both at work and at home Using Magic Mouse both at work
and home Using only external display at work (lid closed in vertical
docking station) 
Restarts only outside of docking station (no matter
if battery only or power adapter attached) 
Newest El Capitan 
No sign of any error in the system log, Crash Reporter, Diagnostics etc. 
No core dumps (yes, I have increased the soft limit for core dumps)
Coconut Battery says it has 91% of original capacity and that is
healthy 
It shuts down even with effectively idle CPU (just chrome, mail - thats it) so I don’t think it is overheating - the fan is not
even turned on 
No message after I power it on again Shutdown looks as
follows: screen goes dark (though it still has the backlight),
keyboard illumination is on - it stays like that for 5-10 secs and
then shuts down. It does not boot up again by itself - need to do it
manually.
I too have a late 2013 MacBook Pro, 15" Retina Display that kept shutting down. I also reset the SMC and PRAM to no avail. With some web searching I found some people claimed it was the battery. I ran boot up diagnostics and it indicated the battery was failing. I replaced the battery, re-ran the boot up diagnostics and the battery issue was gone. However, it kept shutting down. With further web research I found that someone claimed if an HDMI monitor was attached, it did not shut down. (Perhaps in your case the docking station is connected to HDMI?) So, I tried it and sure enough it does not shut down when connected to an active HDMI monitor (i.e. I used and HDMI input on my TV). 

I even took it to the Apple "Genius" Bar. They ran diagnostics and found nothing wrong, but I ran it and showed them the issue still persists. They kept it overnight and ran extensive diagnostics and still could not find anything. They told me for a flat $575 they would guarantee to fix it (i.e. replace the motherboard). I opted out.

I also took it to an authorized Apple repair facility for a second opinion. They couldn't find anything either. 

Now, having my MacBook Pro tethered to a TV was not ideal. Talking with a coworker the idea of building a gadget to act as an HDMI device came up. This prompted me to search the web for "HDMI terminator", to which I found this: http://www.fit-pc.com/web/products/fit-headless-gs (you can get it on Amazon).
For $8.50 I have found a solution to my satisfaction. So far, so good! I can close the lid and it sleeps without turning the fans on as it does with a connection to the HDMI TV. When I open the case, it just works. So short of having a small dongle plugged into the laptop, it works like new!