Your throttle failsafe is not causing the copter to flip on landing. It has nothing to do with anything related to landing or attitude.
This is almost always caused by prop wash hitting the baro causing it to think it is still descending. If your landing is rough, that will throw off the accelerators as well, which prevents them from cross-checking the baro. I suggest you try setting GND_EFFECT_COMP to enabled (1), which is designed to help with this. But you still need to be landing slowly and smoothly to not totally confuse it.