Hi Iam,
Getting the correct normals for polylines can be tricky.
It all depends on the point order. So ensure that you're point order is correct. see image

in this case each primitive has 2 points in clockwise order. if you flip point number 2 and 3, the normal will be in opposite direction.
so using this script, in a primitive wrangle, you will get the correct normals.
/*
calculate outer Normal direction in primitive context
asuming
that each primitive has 2 points
and all primitive points are in clockwise order
*/
//get the points of each primitive (should be 2 points)
int pts[] = primpoints(0, @primnum);
//get the position of each primitive point
vector p0 = point(0, "P", pts[0]);
vector p1 = point(0, "P", pts[1]);
//calculate direction by subtracting and make them a length of 1 by normalizing
vector tu = normalize(p1 - p0);//to flip the normal: use p0 - p1
//the up direction
vector up = {0,1,0};
//calculate N with the cross product
vector n = cross(up, tu);
//set the Normal attribute
setpointattrib(0, "N", pts[0], n, "set");
setpointattrib(0, "N", pts[1], n, "set");