1. Shower faucets were left on and the shower was shut off at the shower head. Hot water crossed over to the cold pipe that way.
1a. A similar defect exists in your washing machine water inlet mechanism. (OT: The wall faucets to the washing machine should be shut off between washes which will also cure the topic of this thread. A leading reason for flood insurance claims is broken or burst washing machine hoses.)
2. Your water heater does not have an expansion tank and as the next tankful was heated, it expanded pushing back through the cold water lines.
3. The cold water line runs very close to the hot water line over some distance or runs through a radiant heated concrete floor slab.
The good conscientious technician or serviceperson will carry extra oils and lubricants in case the new pump did not come with oil or the oil was accidentally spilled, so the service call can be completed without an extra visit.