Sweep1 Grasshopper, question about miter

Im making a handrail generator, there is overlapping geometry. Changing the miter type from 1 to 2 fixes it, but breaks it in other regions. The sweep profile should ideally be consistent, im not sure what the issue exactly is.

(Miter type=1) There is overlapping geometry

(Miter type=2) The overlapping geometry is fixed, but the corners begin to warp/expand.

Handrail Generator.gh (23.0 KB)

Any help or insight would be appreciated :))

The Sweep doesn’t give me any errors.
To position the rectangles, I would do it so that they are all aligned with their respective lines.

Handrail Generator a.gh (34.7 KB)