So magnetic interference can happen really at any time, from taking off around Metal , Concrete < Power Wires , and was very Prevalent with the Phantom 3 and
Phantom 4 Drones, I had two
Phantom 4 Replaced by DJI from Fly always do to Magnetic interference . They offered full replacement coupons.
Now the Mavic drones have been so much better but not immune. , and I pretty confident that they will work with you on this situation as well.
Two things help with negotiating this . One you know already and that is
making sure the Compass is pointing the right direction ,
but also trying to minimize by taking off in the grass ,and not like from a Pier or Parking lot although we do get away with a lot.
If the drone goes into atti mode , DJI will look to see if you tried to use the stick commands to get it back,
other times they will understand that stick movements had no effect on the drone and that is when your likely to get a full replacement from DJi, its going to take a lot of emails and they may ask you for the video as well.
I think this will work in your favor
Phantomrain.org
Gear to fly in the Rain. Land on the Water ,