There are multiple possibilities.
It is possible the new battery is defective, but unlikely since the exact issue was there with previous battery.
Even with a bad battery, the laptop would not go off instantly when the adapter connector was pulled out.
The most likely issue is internal to the laptop.
-The laptop battery connector.
-Another internal connection.
-The charging circuit on the motherboard - or it may have a separate PCB for that.