This topic comes up a lot here and there have been many, many examples of the same thing happening. Your symptom/problem is not unique.
The on-board water pump has a check valve built into it (for this very reason) to keep the city water from back filling the fresh water tank when connected to city water.
Sometimes, when using the on-board pump, debris or dirt can lodge in the check valve holding it partially open. When the pump is shut off and water supply is reverted back to the city water, it will flow back through the stuck opened check valve and fill the tank.
This scenario can also happen if you happen to run the pump while on city water where the city water pressure is much greater than the water pump's output pressure. When you turn on the pump, it will force open the check valve but the city water's greater pressure and flow will force water back into the fresh tank, through the now-opened check valve once the pump is shut off.
Usually to cure, all you need to do is turn off the city water supply, crack open a faucet to relieve pressure, close the faucet, turn on the water pump, re-open/close a faucet a few times and allow the pump to cycle to rid the check valve of any debris. Turn off the pump, crack the faucet to relieve pressure again, close the faucet and turn city water supply back on.
Sometimes the valve can not clear itself on its own and disassembly of the pump (or replacement) is required.
Many folks have installed an in-line check valve near the pump outlet to cure the problem as well.
This complaint is one reason I never leave my rig for more than a few hours without shutting off the city water supply. And, if I am going to be hooked to city water for long periods of time, I will open my fresh water drain valve so if the check valve fails, it won't over fill the tank and bulge it or blow the drain line off.
2016 Flagstaff 8529IKBS Diamond Package 5th Wheel
Ford F-Series SCREW 4x4
TST Tire Monitor - Sinemate 3500w Gen.
2016 Nights Camped = 46