Work plane is flipped not showing up as a property in the element, cant host previously linked elements

Hello, I am trying to write a script to copy in linked light fixtures and flip their work plane because the engineers always put them in upside down. I am got them to copy in just fine (athough id like to be able to all of them in active view, but i cant find a node for that in a linked model). They are copying in and I couldnt find a flip workplane node, but i searched this forum, and found this python script. but it seems like it is crapping out on me. Can anyone tell me why exactly. Also, is there a node to tell these lighting fixtures where to rehost to after they come into the model because they are comming in orphaned, and I have no idea how to fix that in dynamo. Thanks!

Ok so i got part of it to work at least, but it is only flipping one element. Why is that?