I think a possible solution could be something like this. But obviously without knowing what you have in your file so I can only guess , but the logic should be similar to this.
You need to get all the curves that represent the bottom rail (rectangles), all the curves for the top rails (circles) and the curves that represent the sections. I assume the problem is that they are not going to be “ordered” in the same way, meaning you need to have the first rectangle - circle - section to correspond with what you see in each “block”. But as this depends on many things (the order they were drawn, the order you select them with grasshopper…) what you need to do is reorder everything to do the the sweeps.
I am assuming that the circles are the ones with the good order (it does not really matter what you choose, rectangles or sections, actually). Then I calculate which rectangle and sections are the closest to each circle, to reorder them, so that you can do the sweep with the corresponding geometry.
There is only one issue with your initial file: there are 91 bottom lines and 91 top lines, but there 92 profile lines… I checked if one of them is duplicated (but it is not the case) and I cannot see where is the extra one, so just use the script with small portions of your file, until you locate the extra line.
I ran across the same issue with multiple sweep2. All my curves were properly ordered. The solution came from Fernando Ceña. On the rail1 he added a graft. I followed and added a grafton all rail1, rail2 and section. Sweep2 can only one activity at the same time, therefore dividing the work, which is not the case for sweep1. My conclusion sweep2 is lazy.