ArgumentOutOfRangeException in Line Cast API?

My problem posted “Linecast on Recast graph with Links. Exception!
Might be of the same kind, as this one. It also throws exception on line Vector3 a = left[0]

					if (!node.GetPortal(node.connections[i].node, left, right, false)) continue;

					Vector3 a = left[0];
					Vector3 b = right[0];

					//i.e Left or colinear
					if (!VectorMath.RightXZ(a, b, hit.origin)) {
						if (VectorMath.RightXZ(a, b, tmp_end)) {
							//Since polygons are laid out in clockwise order, the ray would intersect (if intersecting) this edge going in to the node, not going out from it
							continue;
						}
					}