Are accidentally fermented foods safe to eat
Do.
Not.
Eat. 

The assumption that it fermented enough to be safe because it fermented some is likely incorrect. Lacto fermented food recipes are specifically formulated to encourage the rapid and significant growth of lactic acid producing bacteria which lowers the ph so quickly that it overwhelms pathogens which are also trying to grow. Even then, consuming lacto fermented vegetables before they hit a ph level of 4.6 is still not safe. Almost no tomato sauces would be acidic enough to discourage pathogen growth on their own. 

Even if the lactic acid in the sauce slowly built up enough to kill all of the live pathogens with acid alone, many food pathogens create toxins (Shiga, Botulism Toxin, etc,) and those could still harm or kill you, even if you heated the sauce up to serving temperature. Though botulism toxin can be neutralized by boiling for some amount of time, after looking around for a bit, I haven't seen anything that guarantees Shiga or other common toxins do too. Is it worth it? 

There are lots of pathogens which thrive in that very environment, and plenty that produce gas as waste. You don't know what was growing in there, or what it left behind.