Not all condiments actually go bad when they expire though. I’m convinced somewhere there’s perfectly edible ketchup from the dinosaurs era somewhere.
Especially when kept in a fridge, since ketchup is shelf stable. In the fridge it should go well past the pull date.
That sounds like an area where someone can sell a device that scans for toxins/mold/etc. Put a sample, if the machine says "Bad" then throw away, if it says "OK", then hope it's not an Elizabeth Holmes-esque shithousery...
No AI needed though, so, not sexy...