Chosen Solution
I recently replaced the battery in my early 2015 MacBook Pro with an ifixit kit and it worked great until yesterday when suddenly the battery says it needs replacing and my Mac shuts down when I unplug it. It is a new battery so it shouldn’t be the quality of the battery, could it have been unplugged?
There is a possibility of a defective battery but if I’m not mistaken there is a disclaimer about this issue in the description for the battery on their website.
You just may have a defective battery suffering from premature wear, as I had ordered a battery for a laptop on ebay recently that was new, yet doesn’t hold a charge even as well as the old one. Sometimes the machine will shut off , I then alternate between the old battery and the new one to temporarily fix this. Seems the laptop’s charging circuit has a fault, and once the battery is shown as full, the machine keeps trying to charge it anyway. Then I would have issues , i would then just unplug and remove the battery while it was on, hold down the power button to discharge the system. Then put the battery back in and plug the adapter back in again. This might help for days, sometimes not. Think mine has a fault in the battery charging circuit somewhere, perhaps the microprocessor to it isn’t correctly charging the battery, and it may show as full, when in fact it is empty, thus the machine would shut off when unplugged. Just a guess.