I was unaware that there was quite a safety net built into this feature. Like many other people, I haven’t enabled the option to erase all data on my phone after 10 failed passcode attempts for many of the reasons listed in the post below.
What actually happens though is that after the 5th attempt, there’s an increasingly longer and longer delay before you can enter another passcode again, so it’s nearly impossible to enter 10 wrong passcode attempts completely by accident.
I’ve just enabled this on my phone, and I recommend you do the same with yours.
To turn it on, go to Settings > Tough ID & Passcode and then right at the bottom of the list of options is the switch to enable Erase Data.