Pixhawk, mavproxy and Compass

I attempted to replace the telemetry connection with a USB cable for the Pixhawk 2.4.8 drone to send MAVLink messages for arming, controlling roll, pitch, yaw, and disarming. After disconnecting the telemetry and connecting via USB through MAVProxy using UDP, I was unable to send the messages. When I reconnected the telemetry, it started working, but the drone became very unstable. Upon connecting to the Ground Control Station (GCS), it displayed a “bad compass health” warning. What could be the issue after switching from telemetry to USB and then back to telemetry, and why did the compass become uncalibrated?

Pixhawk 2 is outdated, and version 2.4.8 is not an official Pixhawk; you likely have faulty hardware and signal noise from the USB interface.