This error may be caused by a failed iOS update.
If something interrupts your iOS update, or if the new system software fails to download or install correctly, your phone might get stuck in an “Attempting Data Recovery” loop.
For example, some users report that they get this error if they disconnect their iPhones from the computer while updating with Finder or iTunes.
It can also happen if you attempt an update when there’s not enough space on your iPhone.
Attempting data recovery screen iPhone 12,