I was flying a Dronebase/Hangar mission yesterday with my Phantom 4 Pro V2. The drone started misbehaving, losing directionality, rotating left and right. At first I thought it was the mission, but then I got some video glitches and I realized something was wrong. I stopped the mission and started returning home. I landed OK manually. I recalibrated the IMU and took a short test hop, everything looked OK, so I resumed the mission. I started getting some glitches again, and stopped the mission one more time and started returning home. Twice I observed the drone tip over about 30 degrees and right itself. I managed to land OK again. This time I took it home and called DJI tech support. They recommended I reflash the firmware, so I installed DJI Assistant 2 on my computer, connected the drone to the computer, and did that. I got a warning about mismatched firmware. When I bought this drone several months ago (used) I flashed the firmware, but apparently it did not complete all the way. No idea why it seemed to work fine for awhile, then malfunction. After reflashing the formware, resetting to factory defaults, recalibrating the IMU, compass, and gimbal, I tried another test hop, erverything seemed OK. I restarted the mission and it completed normally. I dunno, this flying computer thing has a lot of moving parts, as they say. It's a wonder these things work as well as they do (most of the time). Be ready for malfunctions. I was lucky not to crash my drone.