Created walls sometimes join

I have a script that creates furring walls around columns. My issue is that it sometimes joins the walls, and sometimes does not join the walls. I’ve tried using Element.JoinGeometry on the intersecting elements but i may not be using it correctly.
Here’s the image of the graph:

and the result on the test data.

is there something i’m overlooking that might cause some walls to join and others to not join?

@mclough did you check that they are placed in the same way?
Depended Levels, Offsets, heights,constrains,…

yeah, the new walls are the ones around the columns, and they’re all created with the same node (by curve and height). The new walls are created after the original walls are split and deleted.

I developed a test script to better understand how Element.JoinGeometry works and get an odd result.

I test for geometric intersection to match the elements to be joined, but Element.JoinGeometry gives the warning

Warning: Element.JoinGeometry operation failed.
The elements cannot be joined.
Parameter name: secondElement

i expect this is because some of the elements are already joined. What’s weird is that i tested with Element.AreJoined and all the elements returned ‘false’. That said, it JoinGeometry did run for the unjoined elements, just returns null for the others.