Most likely a switch miss alignment caused the derailment.
Unlikely (but not impossible), as those switch points have to be closed (within 1/4”) and locked in that position before a clear signal could be given to proceed. Plus, they are checked monthly to that standard.