The 3-way valve controls the feed source to the pump inlet so it has no effect on flow direction after the pump.
As hot water is exiting the cold inlet, where is it flowing to? Water will always follow the path of least resistance. For hot water to exit the inlet, it will be pushing against and will need to overcome the pressure from the water source.
The path of least resistance should be though the home's hot water distribution lines to where they connect to the return line back to the WH. Are there any valves in the recirculation lines which had been open but are now closed? If there are check valves installed, verify they are allowing water to flow through.
If water can't enter the WH through the supply line, there should be no other source for additional water so water should not be flowing out. Is there another location within the home where water could be entering the hot water system such as a kitchen or laundry faucet equipped with a handheld sprayer control, or a valve on the end of the faucet spout where the hot and cold faucet controls remain open while not in use?
Another possibility is a shower equipped with a valve on the shower arm or handled showerhead which is being used to shut off water flow while the main control valve remains open?
A further possibility is a 'Y' type flexible hose supplying a mixture of hot and cold water to an appliance?
A simple method to prevent water from flowing in reverse out the WH supply line would be to install a spring-type check valve in the supply line below the WH. Unfortunately, that will not explain why a check valve is now suddenly needed when no check valve was needed for the past 10-years.