Something similar actually happened to me once. I was using a Trackmobile (a small machine used to move rail cars around, much smaller than a locomotive) to push a caboose into the service area. I was lined up for a certain track, the first truck went that way but for some reason the other end of the caboose went into the next track. A truck by the way, is the name for what people see as the wheels, usually consisting of the two wheelsets, two side frames and a center bolster, so there's a truck on each end like in that locomotive photo.
Besides the derailment, the extreme angle of the trucks meant some damage from mangled brake rigging and a torn off driveshaft used to drive the caboose generator while in motion. Plus, an old guy named Andy - part of the cleaning crew - had come along for the ride and was inside sweeping when the cab hit the dirt, he was more surprised than shaken up.
This was long ago, probably around 1986. Cabs were being phased out not long after that. I've switched countless cars thousands of times in my career, I never had an explanation for why that one switch popped over by itself like that.