In the above case, it is happening because you want to do a “max (x, 0)” after each “Distance to nearest surface” node, otherwise you will actually be getting the negative values which when multiplied together turn positive again.
But you could also probably get by with less lookups by chaining the result from the 1st DF result to be the offset of the 2nd one. then do it again etc. That way it will search farther if the surface is farther.