No. It is impossible for a product to control a flea infestation overnight. Here’s what would have happened.
The first treatment you applied killed the fleas jumping on your pet before they could lay more eggs. However, no product can stop the flea pupae (developed from flea eggs) that are already present in the home from hatching into new fleas. These new fleas will have continued to jump onto your pet, and you’ll have seen them and thought that the original fleas hadn’t yet been killed.
So, the first product must have prevented new eggs contaminating the home before the second product was applied, in order for pupae numbers to have been depleted in the home by the time the second product was used. In other words, it was actually the first product that was working before the second one was applied.