Answer to "MacBook shuts down randomly with still battery charge left"Hi I had the same issue and after exhaustive tests by me I managed to get Apple to agree that the MBP had a faulty SMC which is an inherant problem with a range of built MBPs. Mine is a late 2013 Retina 15”. If yours is around the same period you can get Apple to check. In the UK we have a 6 year warranty cover so if yours is late 2014 and still same issue then you are covered.
Answer to "MacBook shuts down randomly with still battery charge left"I took this up with Apple who ran a log gathering app and the result is that my SMC is faulty, and confirmed as a manufacturer fault! So advice is to go a Genius bar and get them to run overnight tests, or in first instance contact Apple and request an escalation to the tech support team. If you have been having heating problems with the fans running more than you expect, then you may also have a known GPU heat sink problem - Graphics Processor Unit, where the heatsink material was useless and dried up so no heat transfer and this would over heat the motherboard, and in my experience this could have a detrimental effect on the SMC as well.