Sweep 2 error when creating stairs

The task is to create some stairs with grasshopper. I created a script, but Sweep 2 shows me an error. It says "Sweep could not be created " How can I fix it ?

Stair Simple.gh (21.2 KB)

There is an overlapping section curve at the end, and it’s causing the failed sweep.