Magnetometer just fly away from body in gazebo simulation

Hello, i made a custom hexacopter model and i used the original typoon_h480 model from px4 repository for reference. Propellars are working fine but when i give position command to reach at any point the magnetometer started behave violently and just fly away from the body. Any suggestions on this?