I have a 15 inch mid-2012 MacBook Pro, and recently, after I changed the battery in February at a third-party store (because the computer was out of extended warranty, and the original battery was reaching its end of life), my laptop started to sporadically hibernate. There wasn't any magnetic devices near it (while I was able to put the display to sleep with any magnet, I could wake it up with any key before it could go completely to sleep). And it seems to happen in room temperatures of 30ºC or higher (86ºF or higher), in air conditioned places at 25ºC, it was less likely to happen. Every time the computer's screen fades to black, it would not respond while it's forced hibernating. Only after the fans are off, then I must press the power button to awake the computer. If I connected any external hard drives, they would disconnect upon hibernation, and the failed to eject properly message would show up. When I was on HDD, the grey progress bar showed up and it took several minutes to get back to normal. Fortunately, after upgrading to SSD, the wake from deep hibernation was more instant, but that's still a problem. On El Capitan, checking the console had mentions of "sleep", but on Sierra, no such mention of forced hibernation at all. A clean reinstallation of OS X or resetting the PRAM and SMC did not solve the sleep problem. I cannot afford yet another repair, so what should I do? I searched everywhere on Google, but no clear solution is found, and I seem to be the only one with this problem. Also I have a dented bottom case on the side where the battery indicator is. Could this be a faulty hardware?