Ok. So this happened to me today. Everything was working fine and all of a sudden my phone froze and I couldn't restart it, access the home screen, pick up the phone, or anything. My phone would ring and I could hear my alerts and notifications and nothing would work. I couldn't swipe the screen or anything. Even my Bluetooth headset got disconnected. Then out of nowhere, it came back up but now my Touch ID would no longer work.
So I went to Settings -> Touch ID & Passcode -> typed in my passcode and noticed that the section with iPhone Unlock and iTunes & App Store were both off so I tried to turn it on and I got the same message everyone is getting where it FAILED and try again.
I tried powering the phone off and on a few times and that didn't work. Same thing.
Then I did a restore from iTunes and that didn't work either.
So I decided to do a Restore and chose New Phone Setup - that didn't even let me set it up during setup. Once I finished setting up the phone, I went to Settings up like I had before, and got the same message about it FAILING.
I had given up by now - 4 hours troubleshooting was enough for one device for me - so I did another restore but this time I chose an iCloud Backup that had been done at Midnight that same day so that way I wouldn't have to go looking for my Apps all over again. And BOOM - there it was, I was now able to setup my Touch ID.
Now I don't if it was coincidence that it worked or maybe you have to do a Restore As New Phone first and then Restore to Previous Backup. Either way, I hope this helps.
-G