How old is the battery? How does it look, flat or bloated?
The symptoms you mentioned and the fact that is shows 2 min(utes)/ 96% charged seemed like a false reading. There might be a connectivity issue with the battery but if everything looked firmly connected and cords also looked OK then everything points to a faulty battery REGARDLESS of what the charge level or even health might show.
If you are inclined to dig a little deeper, download the free standalone app:
BatteryInfoView
Run it and examine the following two values: Battery Health and Battery Charge
I also like to test the battery's charge and discharge rate to get a feel for how it handles under "load".
Similar to a car battery. Just because the battery can charge and shows fully charged doesn't mean it can actually hold a charge. A "load test" can be very helpful in determining if the battery is truly "good".
If it can charge up to 100%, then look at the "Current capacity" value.
Disconnect the AC power source and see what the discharge rate is with 1-2 apps open (like a browser with 1-3 tabs open) plus either an email app or some documents. If the battery is supposed to last 3 hours under light use or used to last that long. Then look at the "Current capacity" value and divide it with discharge value.
For example: If the current capacity is 24K mWh (milli Watts hour) and discharge is around 8K milli Watts then the battery should be completely depleted in about 3 hours.
I usually let the app run while also have a browser window open with YouTube showing a 10-hour 4K video of some scenery. I let it discharge for about an hour to see if the values add up and seem within spec.
If during this test, the laptop shuts off, then fair to suspect the battery being bad.
I think you did mention laptop shutting off when the charger was disconnected. That typically tells me either the battery is bad or the DC connector. If battery was actually showing charging/charged yet still shuts off when charger is disconnected, then it is the battery!
If the battery shows 0%-5% but battery is not getting charged yet charger not showing connected then it is either the DC port or the charger. Typically most OEM laptops throws some sort of a warning if the adapter is faulty or below spec (happens with aftermarket chargers).