Single Rebar placed outside of Stirrup in columns

Hey Dynamo Community,

At the moment I am working on the proces of automating the rebar for square and rectangular columns. Most of the rebar is placed just fine. But with certain dimensions of the collumns and with some rebar dimensions one rebar will be placed outside the stirrup. All of the other bars are just fine with any dimension, but this one bar, located at the hooks of the stirrup doesn’t want to stay in place.

However this is only with certain cases, for instance with a colomn of 350x350 mm and stirrup of 10mm. When I select that bar, change it’s rebar shape to something else, and then back it just jumps into place. At the moment I don’t know if this has something to do with the Revit API or the Dynamo script I made…

I am working with Revit 2022 and Dynamo version 2.12.
Does anyone have a solution or an idea to sent me on the right path?