'Sweep 1' fix or alternative solution

Trying to extrude rectangle profile tube along a series of curves. Not sure if Sweep 1 is limited to just one curve at a time, although the component numerous times, or whether there is a fault with my script. Any help would be greatly appreciated.

Many thanks,
Barney

Don’t flatten!?

Nearly worked, there were some extrusions created that weren’t part of the collection of curves, but seem to be from previous geometry. The ‘sweep 1’ command also still displayed as failed. I have since found and alternative solution that may be useful to others.