MBP Retina 15 inch, late 2013 shuts down randomly
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!