Rectangular rebar spiral (Rebar.ByCurve)

Hi Everyone!
I am attempting to create a rectangular rebar spiral, that goes around 4 vertical longitudinal rebars. This is for a driven pile, that has rectangular shape. I’ve gotten so far to create the curve in dynamo, that should represent the axis for the spiral, but when using Rebar.ByCurve, nothing is created in Revit. Is a rebar even possible to be created in Revit using Dynamo?
This is the curve:


and the script.
Spiral_rebar.dyn (128.7 KB)
Those 4 vertical bars are used as input from which to define the offset of the points.
Has anyone ever created something like this?
There’s also and error popping up for Rebar.GetCenterlineCurve.
Version of Revit that i am using is 2024.1 and Dynamo 2.18.1.
Any suggestions on how to get around this problem would be great.

Hi @alvis.narmonts if you can share the Revit file with all the other elements deleted and purged and keeping only the elements used in this script I can look into this.