I don't see anything tying the plates together in the photo. I would assume your walls spread and failed the connections of tie to primary rafter. It looks like you need to install some ties closer to the plate or external flying butresses.