Yeah... the primary isn't that the drone seems to continue horizontal flight uncommanded, the drift is instead in the yaw axis... it's like the IMU suddenly lose it's sense about which direction it points & by that don't apply braking as it should to stop the horizontal movement when you release the sticks.
Looked at this section of the flight path (along the yellow hand drawn line)...
View attachment 161715
It's very apparent that we have an uncommanded yaw rotation when it starts to turn towards the ship, the drone even continue to turn in the opposite direction to what you command.
Comparing the IMU & GPS velocities clearly show big deviations ongoing during the incident... & your flight mode change doesn't stop it, instead it looks to be that your drone get away from the ship.
The red is the velocity deviation North
The green is the velocity deviation East
The thin blue dashed is your rudder commands
The thin black is the yaw axis
Pink background is Sport
Blue background is Normal mode
The IMU & GPS velocity deviations should normally be very close to 0mph, here we see deviation growing up to nearly 22mph in Northerly direction & a bit later up to 15mph in easterly direction. The incident calms down (& the velocity deviations) when the drone ends up right above the ship at 43sec into the flight... the velocities gets then somewhat erratic when your drone leaves the ship & then all returns to normal.
View attachment 161716
Without a proper .DAT log we don't have access to all needed data to determine the exact changes in mag field strengths & how the compass were affected during the incident... but my belief is that something severely disturbed the compass just there close to the ship, that made it act up in a similar way as during a yaw error incident where the drone have been power up in a magnetic disturbed spot.