It really really looks from video that stabilization is backwards / incorrect.
It starts a little unlevel say leaning left, so it tries to make it go right, but because it is backwards it goes farther left, so it tries even harder to go right which ... in human time it instantly flips.
Reading back, I see your first post you say
I can see that pitch and yaw are in reverse, that means, when i grab the copter in my hand and pitch it down, in the GCS flight data panel, it looks like yaw right.
If it still does this than that is your problem, which says that either FC is not mounted normally or at least that RotateVirtual does not correctly match the way the FC is mounted. This will definitely cause this instant flip.
Wiki has info about how to adjust RotateVirtual for different FC orientations. If FC is mounted normally, RotateVirtual should be 0,0,0
I added some detail and suggest that you re-read my post about the things that cause flipping.
https://forum.librepilot.org/index.php?topic=3994.msg26880#msg26880Good luck.