Your case reminded me that I had a similar one some days ago, but got no warning on the screen. Namely I was in a descending procedure from a higher altitude and came at say 40 m over the church’s metal roof. I deviated to the yard and all went well down to landing. But uploading the flight data to AirdataUAV I noticed the AC has recorded a compass error warning exactly when the bird had to deal with the large church’s metal roof.
Ideea is the compass doesn’t like at all any large metal surfaces, so you would better avoid flying over such. There are known cases (see on YT) with drones that crashed following a flight over / around a ship, the huge metal surfaces compromising permanently the compass.
I had to fly these days around a huge Liebherr 1600 crane, involved on a highway construction. Uploading the flight to AirdataUAV, I found that the max compass turn rate per 0.1 seconds became 11.50 value which is huge compared to values as 3.50-6.00 I usually get. This is still inside the acceptable span of 15-16 degrees per 0.1 seconds, but it’s obvious the bird didn’t liked at all the vicinity of the crane.