Sort curves along curve

Hi everybody!
I want to create ground surface, so I need to sort curves along curve. I sorted middle points along curve, but some points didnt sort and i lofted wrong surface. What is my mistake?

ERROR (16.1 KB)

You’ll have to deal with duplicate lines and also you should provide a proper guide curve for Sort Along Curve.

ERROR (17.8 KB)