Its like when one comes out of the engine house, and hits the switch, its like the engineer or conductor forgot something back at the shed and he pulls a U-Turn right there that looks like this:
This may sound silly but it almost looks like there is a super small loop there. Trains in Trainz will go around some incredibly sharp curves (though there is a limit). Look idiotic but won't always derail.
See what happens if you delete and re install the switch perhaps?