The laptop stopped charging the battery. The laptop shuts down as soon as you unplug the AC adapter. The laptop works fine from AC power even when the battery is removed.
1. Bad battery.
2. Motherboard failure.
Most likely this problem is related to the battery failure. The battery is dead and has to be replaced.
If you replaced the battery but it didn’t fix the problem, you have a faulty motherboard. Apparently, the battery charging circuit on the motherboard is not functions properly. You’ll have to replace the motherboard or use the laptop as is.
You cannot tell if you have a faulty battery or motherboard without testing the laptop with another known good battery.