As indicated by the dashed noodle, the 'Distance' pipeline is a callback. It's a function, ready to be called with whichever parameters it's given. You have to read the tree backwards to figure out what those parameters are.
The routes marked with blue boxes in the illustration show the 'Distance' function being called on the geometry entering the Output node, which is deformed. That's your current situation, simplified a bit. The 'Distance' is from the points to the deformed geometry.
The routes marked with green boxes in the illustration show the 'Distance' function being called on the geometry entering the Capture Attribute node, which, at that stage, is not deformed. The 'Distance' is from the points to the undeformed geometry. It's captured at that stage, and passed on to the output.
Here's a shader mixing the two different distances:
.. and this is the difference.. (the solid red being the distance from the points to the plane while it was still flat):