A coupler failure on a train split it into two parts, narrowly avoiding disaster for 1200 passengers.