Domain Box resulting in inconsistent boxes

Hello

Essentially I have 38 floors on my building. The outside of each floor plate will be a balcony. Each floor has a different amount of sides. I want there to be dividers on each balcony. I have drawn all of the lines that should represent the base curve for each divider.

My problem is that when I feed these base curves into the domain box function, as well as the domains required (I havent specified this fully yet so dont worry about it) - a few of the boxes come out strange.

Most of the boxes are fine. Some however, are rotated about 90 degrees about the base curve - there is a reference in photo 1. There are also some that are rotate 180 degrees about the base curve - they are essentially upside down and protruding into the floor below. You can reference photo 2.

I am not sure what the problem is here. I think it is that I am not providing a plane, and providing a curve instead for the domain box. However, if this is the case, how can I draw a domain box about the lines I have drawn? If it is a simple fix, just tell me what I am doing wrong please. Thank you for the help!

2019.03.15 Attempt 3.zip (38.1 KB)

you can simplify the definition
2019.03.15 Attempt 3_mod.gh (31.9 KB)

and to fix the rotation you need to fix planes directions
why you use Center instead of Polygon center?

Thank you very much this is perfect!