Phantom 4 Pro Compass will not stay calibrated

Recently we replaced the legs on our Phantom 4 Pro. The hind lights now flash red/yellow which indicates the compass needs to be calibrated. I calibrate the compass, the lights flash green for about 1 second and then go back to flashing red/yellow. Any thoughts on where the problem may be?

I would check all connections and check if you pinched a wire when you put it back together.