Problem with GPS spoofing using Mavlink message (GPS_INPUT): heading dramatically changes during flight

Hi everyone,

I am trying to simulate the GPS spoofing by sending the fake GPS data via the Mavlink message: GPS_INPUT. In the message, I include the information of latitude, longitude, velocity in north and east direction. All the information comes from the current state (i.e., vehicle.location.global_frame, vehicle.velocity in dronekit). When I try to run the simulation, at first, the drone flies with the given location as expected, then after a while, its heading changes dramatically, and velocity also experiences a huge increase. We do not know why this happens. Below is the log: