Chosen Solution
I have a Elitebook HP 840 G4 laptop. I replaced the battery as it was stuck at 40% charge and was bulging. After ordering a new battery from IFixIt, I’m experiencing some issues. I calibrated this battery by charging it to 100%, then depleting it to 0%, then charging it back to 100% While on battery, I have no issues. I’m able to use the machine just fine. When I plug the machine in to charge, it works until it charges to 100% and it remains plugged in. Then the computer will randomly shut off. This only happens while at 100% and plugged in. Eventually, the laptop will shut off with no warning. Some things I have tried. Bios and other driver updates Power profile check to ensure nothing appears odd. Another round of depletion to 0 and 100 to charge. Downloaded HP Hardware checker and ran a battery test Happens on a docking station or its standalone power adaptor. Tried a different outlet in a different building. Checked to make sure battery doesn’t need reseated in chassis. Occasionally when going from 0% and charging uninterrupted to 100% - laptop will not power on and charge LED remains on (even if I unplug the power) usually the fix is to hold down the power button for several moments - the charge led will go off, flash 3 times, and eventually let me turn it back on. I checked voltage on battery at full charge. Shows 13vDC I really don’t want to imagine it being a bad battery. But I’m not sure what other options to go with. Any thoughts? Update (08/05/2022) Thank you both for your advice. The battery connection was seated okay and I tried reinstalling the driver to no avail. I ended up taking the battery out and replacing it again, but it was used (but newer) battery from a 850 G3 model (same battery - thank God for close generation laptops using similar parts) I have had no issues with this battery. So I surmise it must have been the new battery after all that was the problem somehow. Which is odd considering the voltage showed okay and the repeated battery tests from HP showed okay. All in all, this chapter is closed. On to the next mystery.
Try uninstalling the battery drivers in Device Manager.