I would guess spatial disorientation.
The compasses were probably all correct but the lead pilot somehow didn’t believe his.
He flew by seat of his pants instead of sound aviation techniques.
I don’t know what instrumentation those aircraft had, but every one I flew had dual compasses for the very reason that the do occasionally but rarely fail.
So a question: What was the weather?
Had these pilots completed their instrument training or were they still in training?
Five compasses failing simultaneously on five different aircraft is not only impossible but the concept is ridiculous.
Remember, the magnetic compass has been used on ships as far back as the year 1400.