Sorry for your loss Connor. I suspect there was ferrous metal in the ground around you that played havoc with your compass.
I've seen a number of Phantoms react similarly when they're flown around large, ferrous objects, such as playground structures in a park, or automobiles in a parking lot...