This used to happen quite frequently with CBC coaches. In most occasions though, the parting would happen when the train started after coupling the loco. This time, the CBC might not have locked just enough and the sudden emergency stop would have unlocked it. Good that no mishap happened.