Chosen Solution
Since replacing the battery in my mid-2012 MacBook Pro with an ifixit.com replacement battery, it now shuts down randomly. I’ve heard about a firmware update that could resolve this but don’t know the exact details. Can someone share how to fix this?
Try updating the firmware. See if that works. If that doesn’t work then try cleaning the battery contacts with some alcohol and a toothbrush (carefully). If that also doesn’t work then it might be that you got a bad battery. If that’s the case, then contact iFixit for a replacement battery.
I would check the CMOS battery first before blaming the main battery. This battery will cause a computer to shutdown randomly or not startup at all. I’ve had several computers with that problem, laptop and PC. Its an inexpensive fix and fairly easy to check on most laptops though some can be moderately difficult to get to. Hope this helps. Eddie