Minecart rotates from z-axis to x-axis when rails underneath it are broken.
If I place any type of minecart on rails parallel to z-axis, when I break the rails underneath the minecart, the minecart always rotates to direction parallel to x-axis. Direction of rail breaking, or blocks positioned around the minecart, do not matter.