My opinion is that you should be looking to revamp ypur family database to level based families Instead of creating a project of reference planes to attached to. There is no capability in the API to then change the host from a reference plane to a wall.
There is however possibility to lock the reference plane to the wall once it is created but then with wall thickenings etc etc your just in a bad spot as well.
Alternatively, only use symbols at this stage and then write a script to create the families on the surface located at that point when the walls are drawn. (Using the Api to host elements on a surface from creation is possible, just not “re-hosting”)
Id be looking to make a script to “hunt” for the surface to move the fittings to instead of hosting it (with level based familes)
Else be prepared to draw every fitting project twice or face unprecedented mistakes.
I despise hosted elements. I think the developers intent was good when revit was in development, but the short-comings are pretty bad. There are some obvious hosted-elements like doors and windows which make sense, but for other items, using a workplane-based family accomplishes the exact same thing, without a lot of the drawbacks of category-specific elements.
I wonder if modeling the walls themselvs isn’t “easier?” Yeah, dynamo is great, but it can also be an achilles heel. I’m not sure about your workflow, but using the pick-line command to model the walls might serve it well.
I’ve also received this error a few weeks ago, but I can’t remember what for. I would try generating a line in dynamo, and checking it’s length / seeing if it is planar.