Raycast in Orthographic Camera View

There is a python template that ships with Blender called “Operator Modal View3D Raycast”. If you run the operator it will move the 3D cursor to the location on a mesh where you click. It works great as long as you are not in an orthographic camera view. It works just fine in a perspective camera view and it works fine in a regular orthographic view, but as soon as you are in orthographic camera view the raycast function doesn’t work. Anyone have any ideas on how to fix this?

I’m also trying to solve this issue, obviously no solution has been found so far?

you need to raycast parallel to the camera vector, getting the mouse position in 3d space as the ray offset.