TL;DR
Be more specific in what situations a train can switch from one station to another stations with the same name when repathing.What ?
In https://wiki.factorio.com/Railway/Train_path_finding is a long list of when a train with revalidate it's path and when it will repath.What isn't clear is in which situations the train might switch from one station to another station with the same name. Can it ever change directions on a repath? (don't think so)
It's also undocumented I believe what happens when a train reaches a (temporary) train stop without a schedule condition. The trains schedule advances as soon as the breaking point hits the targeted rail. But how is the path for the next schedule index then calculated? Or more precise: from where?
Will the train always pass the targeted rail or can it repath to bypass the rail? Can a train change direction at a schedule stop with no condition or will it only search in the direction the train is moving? Can it get stuck with "destination full" in the middle of a junction or hit itself? Or will it follow the previous path till it hits the rail target before getting stuck?