Relate Objects by Matching Midpoints and Sorting

I want to take the midpoints of objects from one set of data and relate them to the midpoints of a second set of data in order to sort the second group in the same order as the first.
Is the logic of this setup sound? It doesn’t seem to be giving the result I expected.
image

Hi Jmarsh, The index is the sorting order, your Sort List is putting the indexes in numerical order (undoing the closest point sort)

Here’s an example. If you’re having issues please internalize the points (right click on a point container) and post. Thanks.

re_closestPoint.gh (10.5 KB)

I figured it out late last night by flipping the C and P. I think I was finding the closest point order and throwing it away then sorting by the order it was already in.
Thanks for the explanation.