If I remove the highlighted rail, the cargo wagon will open without changing angle. It appears to move slightly forward, but I'm not sure if that's a position change or just a difference between the sprites.
I also note that if I replace the highlighted rail with a straight rail, the wagon also does the apparent north/south move, so I think it actually is changing position based on the non-mandatory rail behind it.