I try user Raycast with "Align Euler to Vector" node. Target is simple rotate plane (4 vertex).
As a result, some triangles are rotated incorrectly. What's wrong ?
Here's how your setup is evaluated:
I tried to make it clear Object Info and Raycast nodes are evaluated two times each. So if you duplicated those nodes, I think the execution would be exactly the same (maybe some optimizations wouldn't kick in, but other than the evaluation time, the result would be the same):
While the Object Info node might have some cache, because it returns the same data the second time, the latter, the Raycast, is given different Source Position - the 2nd time it's the position of the instance, which is already positioned on the plane.
So it is now up to the quirkiness of the floating point calculations if a ray shot from the plane down will hit the plane or not. With node wrangler enabled, CtrlShiftclicking the Instance on Points node (the context) and the Raycast node (to read values for this context) will reveal Is Hit for many instances (those with wrong rotations) is ❌ False.
The simplest fix is to edit Plane.001, duplicate the plane and move it down. Now there's a second plane with the same normal to be sampled by (7) node.
The proper fix is to use a Capture Attribute node, to remember the Hit Normal to not have to run the node again (it will therefore also reduce the evaluation time of the setup):
More reading: