Sweep 2 is not sweeping all the way

Hi,

I am trying to sweep a particular cross-section across a closed surface in a continuous loop. The desired cross-section is getting disrupted in between the enclosed rail and i am not able to achieve a great end result.

Additionally, the edge of the surface is not smooth as you can see in the image , though the curve is smooth.

Could anyone tell me what I am doing wrong? Is it becasue the shape of the table is uneven ?

Or how to alternatively make this shape. In the image here I show the surface I desire created in rhino and the sweep command in grasshopper.

I am also attaching a reference image for my outcome.

table curve 2.gh (16.6 KB) table 002.3dm (85.7 KB)

reference image.png