Vectors - Am i doing something wrong?

I’ve made a script from reading through this link (many thanks to Dieter) to create section views as plans at family instances. These families are modeled as manholes with ‘always vertical’ checked, so when i host it to a slab it stays vertical.

I just tested it on a sample project which i made with a varying slab and several manholes at different levels and it worked perfectly.

I then went onto a live job and for some reason some views couldn’t be created returning a null value. It seems that any family where the yaxis and zaxis xyz all equal 0 aren’t created.

Is this something i have done wrong in revit or dynamo? Thanks in advace, i’m still trying to get my head around all this.

Below is the node values for the CoordinateSystem.ByOriginVector node:

Also, in line [0] you can see that the YAxis = Vector has xyz coordinates that aren’t a whole number, meaning the section that is created is on a slight slant. Is there any way to fix this?

Here’s the vector creation part

Just tried it on a different live project with about 10 instances and its worked again, apart from one where VectorX= -1 and all the others = 1 so the sections looking from the wrong direction. I don’t fully understand how its determining whether is a positive or negative.

The affected view is coming from the positive vector shown below:

I think it must be the direction of the line of best fit as the start and end points all seem to be fairly similar.