Laptop turns off when power adapter is plugged in

My laptop turns off if I don't have my power brick plugged in so I thought the battery was failing. However, when I ran a software to check the battery, the results were fine. I also checked the battery health info found in the BIOS and it also told me the battery was ok. What could possibly be happening here?
