It’s probably because of the large number of control points, so I rebuilt the curve and the resulting sweep is perfect, but I prefer not to rebuild this curve (as other things in my model depend on the same curve…)
your rail curve is a complex polycurve
_explode
_gcon
will show that the curves only have G0 (position continuety) at the position where the waves / overlapping occurs.
you should make sure that the curves have (or the polycurve internally) at least G1 (tangent) better G2.
you can also add additional shape/cross curves exactly at this position or do separat sweeps for each section.
kinks (G0) at the rail might work well for planar curves - in 3d it is not 100% predictable even if Rhino try s its best.
dear @wim … there is multiple curves in the file.
the problem is not the system, it s the rail curve as described above.
i managed to reproduce the wavy, overlapping result: