You're assuming natural selection selects for not flipping over, when in reality, it selects for the winner of the shell flipping contest as presumably without intervention, the flipped tortoise does not breed, while the winning tortoise does (or at least still has the opportunity to)