I think this has to do with the range to destination hex. The distance (20 direct hexes) is triggering a different code path which is determining that there is no path to follow. The code actually has a comment "this should not be happening". Which tends to suggest that it has.[:D]
Will try to backtrack the movement and see how it should behave.
One thing I would say is that the movement routine probably could be having issues with a long movement. My suggest is that a long move be broken up into segments - example the move from Alice Springs to Rockhampton could have worked better if it was A.S. to Adelaide, then to Melbourne, then Brisbane, then to Rockhampton. Not the best, but I have a feeling that this also the suggested method in the original game.
Edit
Changed the distance and the unit stayed on RR. So this narrows down the problem.
I had this happen to me once in India, but I wasn't knocked clean out of the rail hex like you were. I could have been subject to air interdictment, perhaps that was a legitimate cause?