Post a video so we can see what is happening.
FWIW, flipping on take-off is always a motor/prop problem.
Verify that you are using the correct motor layout, and that the motors are connected correctly to the motor outputs on Pixhawk.
Use Motor Test in Mission Planner > Initial Setup > Optional Hardware > Motor Test to verify the motors are spinning in the correct directions.
NOTE: Motor Test will test the motors starting from the RIGHT FRONT and proceeding in a clock wise direction. Motor Test DOES NOT follow the motor layout numbering…