Modifying wall location line is not updated correctly in larger script

Hi.
I’m making a script where I create new wall types from existing wall types and change the original ones to these.

But in order for the script to work properly the walls needs to be set to Finish.Face.exterior.
But when include that part of the script that changes this it still uses the original location.line like for instance wall.centerline placement instead of the new one.

I have ofcourse tried to use the passthrough node, but it doesn’t seem to do the trick.

Anyone got some suggestions on how to get i use the new location before changing the wall type?
Splitting it up in two scripts is not an option.

Here you can see the issue when running the script.


I have included the graph below and also included the script.

Dynamo wall location test.dyn (34.1 KB)

I found that @ BIMadmin had the similar problem but with not apparent solution
https://forum.dynamobim.com/t/modify-wall-location-line-and-wall-types-in-the-same-graph/18928

script beow