How to flip the direction of the 2 wrong catenary curves's end points?

I’m trying to build this script following from How to rhino " https://www.youtube.com/watch?v=IKtKvkJu69E&t=728s ".
The problem is 2 curves are occuring to have different reverse endpoints from the others based on ( sort list using distance for the value of Keys ). I don’t know how to make these 2 curves follow the other curve direction.
May anyone help?

Thank you so much for your help

This is my script
GOOGLE BAY VIEW 1.gh (29.3 KB)

GOOGLE BAY VIEW 1 Edited V0.gh (40.1 KB)

Thank you so much, i understood your script

if you take a look at my script, 2 curves have different directions (endpoints are not in order) from the others, so can you flip these 2 curves?