There are several very unlikely explanations (guesses) put forward in this thread, but this is the most unlikely.there is a possibility it could be your batteries if you're having a cell deviation the flight controller will prioritize stability over control this is the drones attempt to stop it dropping out of the sky on you
There is no way that cell deviations would cause what the OP described.