When you trace a ray exactly to a vertex or edge. The normal returned is the normal of one of the bordering faces, which one seems more or less random. While is is not really a bug, it does sometimes lead to unexpected results.
I have a blend file generating above picture to play with, but I first need to upload it somewhere because you can’t attach .blend files here.
If you move the empty up or down, the normal flips randomly between the normal of the top face and the bottom face.
Turning on smooth shading on the mesh sadly does not help. I had hoped this would cause the normals to be interpolated, but apparently the raycast node always returns the true normal.
I was wondering how hard it would be to return interpolated normals here. I’ve been stepping through the code a bit and I do see some places where I might do something, though I don’t really understand the code yet.
Would this be an interesting thing to research, or is the general feeling here that this is expected behaviour for the raycast node?