I think I found a solution. Increasing friction control to 10 and disabling all types of reaction wheels worked for me.
I suggest you should bind a hotkey to toggle the reaction wheels when needed, because it's the best way to get back up when you're about to flip.