I don't have any experience with Kobalt 24v stuff but I doubt it's the charger. It's very likely the battery voltage too low so the charger recognizes it as bad. But of course your charger could be bad.
Commonly a cell or bank(s) of cells unbalanced with the rest. 24v is 24v max so nominal should be about 22v. Check the voltage of the battery pack. I don't know what Kobalt's low voltage cut off is but if the pack is in the neighborhood of 16-18v it's probably overdischargedthe
Edit: Just noticed yours is 18V so figure 13-15v or lower for being too low.
Lots of videos on youtube showing how to "jump start" a battery to bring up the voltage. I don't like the method of simply connecting another battery to the low one although it can work. I personally open up the pack, measure to find out which bank(s) is low, then charge them individually to bring up the volatge.
So far I've had 3 of my 8 yr old M18 batts had banks overdischarge just in the past year. My fault for not keeping them in rotation. After "restoring" them they've been work perfectly fine without issue. YMMV