I think this has to do with the onboard compass and the true magnetic north. See e.g.
Magnetic Declination on Map for your location.
I remember I had this issue on my old NAZA drone: I physically rotated the GPS puck w/compass a couple of degrees for my location based on the above site, and the drone suddenly flew straight.
I don't know how the true north offset is calculated and compensated for in
M2P. I'm assuming the DJI app & drone determine their gps location prior to crunching the numbers, then the calculation is performed (locally? on a dji server? internet connection needed? dji leaving us in the dark here...), and then the magnetic compensation is applied to the heading/course for a straight flight at that location. This is my logic
maybe dji does it differently.
But one thing is for sure. Every location you fly has a magnetic offset (and possible local magnetic fluctuations), which affects the compass, and
M2P should/must somehow compensate for it. And when it does not (for reasons unknown), your flight is not straight.
My
M2P has the same issue, but only sometimes. Some of my flights are as straight as an arrow, yet others are not; it can be clearly seen in the video. And sometimes it happens during a straight flight for a minute or two... I, too, am stumped.