No. Boiling inactivates most live bacteria, but substances released by some bacteria as they multiply are heat-resistant and are not destroyed by boiling. In other words, the number of bacteria drops after the pot boils, but the underlying problem remains. Food showing signs of spoilage cannot be rescued by boiling; boiling is not a repair method.
Boiling is the kitchen method people trust most, and that trust is partly justified. Boiling water quickly inactivates most live, multiplying bacteria; that is exactly why raw milk is boiled and leftovers are reheated. But it is as important to understand what boiling does not do as what it does. The bacterium itself and the substance it leaves behind are two different things, and the two respond differently to heat. If this distinction is not understood, boiling can be mistaken for a guarantee and lead to the wrong decision.
As some bacteria multiply in food, they release substances they produce. These substances remain in the food even after the bacteria die, and some are exceptionally heat-resistant; boiling does not destroy them. In other words, when the pot is boiled, the number of bacteria drops, but the substance remains where it is. When that substance itself is what causes illness, boiled food is no safer than unboiled food. Appearance and smell often do not change at this point either. The more of the substance there is, the more severe the result, and there is no way to measure that amount at home.
There is also a second heat-resistant form: spores. When conditions become difficult, some bacteria enclose themselves in a thick shell and continue to survive even in boiling water. When the pot cools to room temperature, the spores wake up again and start multiplying again. For this reason, boiling food in the evening and leaving it on the counter does not clean out the bacteria; it starts a new cycle. Cooked rice and pasta are the foods where this behavior is seen most often. If rice is cooled and refrigerated as soon as it is cooked, this cycle never starts.
There is a clear point at which boiling really helps: before unsafe storage, not after it. When a properly cooled meal has been kept in the refrigerator for two to three days, reheating it to an internal temperature of 74°C / 165°F addresses bacteria that may have grown during storage. Here, heating is a safety step because the food has not been left standing for a long time beforehand. The same process does not do the same job for a pot that has been sitting out for hours. Reheat it once, and do not reheat the same portion again.
For this reason, the deciding factor is elapsed time, not boiling. If you do not know when the food was cooked, how many hours it stayed at room temperature, or how many times it was reheated, discard it. If there is an odor, a sticky surface, bubbles, or a change in color, discard it as well, and do not taste it. Boiling serves as a safeguard in only one situation: making a questionable home-canned food harmless before disposal. Even then, the goal is not to save the food but to dispose of it safely. Do not weigh the cost when food is questionable; throw it out.