Restore an iPhone 12 that is corrupted beyond the point of being able to update/restore
Recently, someone came to me asking for help when he got an iPhone 12 second hand and it was not wiped upon being handed to him. I noticed signs of some files being corrupted, like the time/date being very wrong, the language being different, and the iphone kept looping a 1 hour "iPhone Unavailable" and even though I did not touch the phone after that for more than an hour, I came back to it to see it had restarted back to 1 hour the second I picked it up. I tried using my laptop and the Apple Devices app to Update and Restore, but it gave me an error saying that the software corrupted during the update. I cannot restore the device. What should I do? I and my friend DO NOT have the Apple Account password nor the device passcode. Help appreciated. It also is not very clear exactly which model of iPhone 12 it was, all I know is it's from the iPhone 12 lineup. EDIT: Attached is a picture of the error.
iPhone 12