Your battery was at 88% health, and they still replaced it for $29? You're only eligible if the battery is at 80% or lower. My 6S+ was at 79% and I too took advantage of the offer.
There are two different metrics for testing batteries, the default test that Apple has does not detect how much current the phone can maintain at max, just how much battery power it stores.
Here's the typical car analogy. Compare the phone battery to the cars fuel tank and pump. The battery does similar to these two units in the car.
Fuel tank is how much fuel... or in the battery case how much charge it holds.
The Fuel pump determines rate of flow and maximum flow of fuel possible.
The basic tests that apple use and determine if a battery needs to be replaced used to only test for How much the battery holds. or in this case, how much is in the tank.
the issues with the batteries that affected this situation was not how much the tank held, but how well the pump was working. Like a car, if you stomp on the gas, but the pump fails to deliver required amount of gas. you get a stall. Similar, if the CPU went to 100% very fast and suddenly, but the battery couldn't deliver enough "fuel", than the phone would shut off.
The batteries that Apple put in the device were fine from a "fuel tank" perspective, but were underspecced from a "fuel pump" side of things. So their tests didn't catch it, and the batteries hit that "degraded" state much faster than intended. Most devices generally are built in with enough "overhead" in the pump portion that it should be 2-5 years before the threshold is hit that a phone would shut down due to insufficient power. Unfortunately due to the underspecced battery, this was occuring in 1-2 years. Most of us consider that insufficient.