This looks almost like a "wont fix" because it is just extremally annoying consequence of the fluids rework. Marking entities to deconstruct is not an instant action applied to all entities at the same time, under the hood this is performed sequentially so the bug effectively reads as following: "in some cases when i first mark the right pipe to ground to be deconstructed the left pipe to ground that has a water in it connects to the not to be deconstructed pipe near the oil refinery". Before the fluid segments rework that would not be a problem because the fluid would not be transferred until the fluid update, however after the fluid segments were introduced, this intermediate state causes segments to be merged immediately causing some water to propagate.
Core of this behavior can be observed with this configuration:
12-05-2024, 00-25-10.png (78.93 KiB) Viewed 219 times
In this contraption when the inner 2 pipes to ground are marked to be deconstructed, the storage tank on the left will fill with the water. After emptying the storage tank, undo which is also performed sequentially is also going to cause the same issue regardless of the cancel deconstruction order.
Boskid is correct, for the time being this is "won't fix". It is the result of the segments sharing a single fluid buffer. Fixing it will be non-trivial and will be first on my list for 2.1.