I am currently unable to access the game for testing as I am in the hospital.
However, I have reviewed the current script logic, and theoretically, this error should not occur with the valid entities. It is highly likely caused by "dirty data" persisting from an older version (where a non-station entity might have been incorrectly registered to LTN).
Since I cannot trace back through older versions at the moment, could you please try the following:
Mine and rebuild the Rift Rail entities (especially if they were placed in a previous version).
Try using the "Clean Connections" (or Reset) option in the Mod Settings to clear out any invalid data.
I am not 100% sure if this will resolve the issue immediately, but it is the best workaround for now. I will investigate this in more detail once I am back at my computer.
Thanks for your understanding.