Hi Anqurarora,
I also had problems with fifo overflow and randomly hanging loops.
Taking another mpu6050 sensor solved my problem totaly.
Wenn sensor, once in a while, is wired wrong but not totally fried yet, smaller pieces inside the sensor could be more or less damaged? Can't think of another reason.
Conclusion: trie a fresh sensor.
Succes,
skpprRlf.