I think it is called cognitive dissonance!
Quoted from a from a analysis on the ABC website:
In 1957, social psychologist Leon Festinger published a study about a small cult in Chicago called The Seekers.
Its members spent their days preparing for the arrival of an alien flying saucer, which...