MacBook Pro (Retina, 15-inch, Late 2013) shuts down when not attached to Thunderbolt Display
Try resetting the SMC (https://support.apple.com/en-us/HT201295) and the NVRAM (https://support.apple.com/en-us/HT204063)