This is rare because it can often hurt a group. Use the event as a challenge to act even more zealously. The group proved its devotion and vowed to become even stronger. The level of in-group social support . The more solidarity and communication, the better.
Size helps, but coherence is more important.
Role of leadership. The quicker, more confident, and higher amount of charisma that the leader uses, the better. Scope and sophistication of ideological system. The more complex the ideological system, the easier it is to explain the failure and therefore it is easier for the group to recover. Nature of the prophecies and the actions they inspire.