How the Normal Map baking works, what is the ray direction
So first, let's make sure we define what &quot;inwards&quot; means.  I'm going to say it means in the opposite direction of your low poly's normals.  So if we were to draw your low poly's normals on your graphs above, the normals would be pointing upwards.
As of 2.91.0-ish, rays are shot in the opposite direction of the low poly's normals-- that is, inward.  Rays that fail to intersect cause 0.5,0.5,1.0 to be written (which is the same thing as saying, using the low poly's own normals.)
My memory of this in earlier versions (like 2.79, 2.80) was that rays were shot in both directions, but you would still want an enclosed high poly, because rays shot in the direction of the low poly's normals would hit the backfaces of the high poly rather than the front faces, and you'd get screwed up normals.
&quot;Ray distance&quot;, just a version or two ago, referred to what is now &quot;Extrusion.&quot;  This means to start the rays offset in the direction of the low poly's normals.  It is exactly the same as baking from a displaced low poly, or baking from a cage with a numeric shrink/fatten operation applied to all vertices.  To be explict, this does change the origin of the rays.
&quot;Max ray distance&quot;, as implemented a version or two ago, means that Blender will just discard results that arise from intersections greater than a certain distance.  I'm not really sure what the intended use for this is, although it can be useful for some texture baking situations that are selected-to-active bakes but couldn't reasonably be described as high-to-low bakes, like baking text objects to a texture or something.  This does not change the origin of the rays.