I assume that there is a mesh which you are expecting your
ray to detect. What direction are the normals to this mesh facing?
If they are facing away from the ray, then the ray will not detect
the surface of the mesh.
A ray will only detect a mesh the first time it encounters
the mesh. If you have a mesh in the shape of a Z, for example, and
fire a ray at it from below, the ray may pass through the mesh
three times, but only the first "impact" will be detected.
If a ray goes precisely through the vertex of a mesh, it may
not be detected: you can see a demonstration of this
It might help to fire your ray at a slight angle to the