Are you talking about storage tanks? I just tried to reproduce the issue, and for me circuit wires stayed connected as expected when replacing different qualities, as well as when using an upgrade planner to upgrade from normal to a higher quality.
Using an upgrade planner to upgrade entities of higher quality is much more difficult, since you'd have to select the "qualitised entity" as the correct source entity to be upgraded, but I don't see how that could cause this issue either...