Uhhhh ... the two debug outputs aren't the same. (?)
At what stage in the restore process did it kick out that error? Can't tell by copy and pasted text.
Did you follow the link to 'about this error'? Those talk about earlier versions of Moodle and Windows. Don't think that's our case.
Now back when you un-archived it, and put a tmp directory in the un-archived folder, then supposedly re-zipped/changed extension to .mbz to attempt ... did you use the edited .mbz archive or go get another backup .mbz.
When Moodle extracts the .mbz it expects to find a moodle_backup.xml file at the root of that contenthashed named **directory** .... the screen shot shows your system is *not* recognizing it as a directory but a file ... mime type text/x.generic (never heard of that one) ..... so yes, I'd say something is messed up.
Could the .mbz file be corrupt ... certainly.
Let's try this ... manually remove anything in moodledata/temp/backup/ .... nothing there. Safe to do as it's a temp area anyway.
Take the .mbz file you've not messed with - **make a copy of it** - **un-archive the copy**. You should see a moodle_backup.xml file at the root of what is un-arhived and xml files that relate to diretories ... like files.xml ... files directory.
See attachment screen snap to see what that looks like. BTW, used the following command to extract the .mbz in a 'test' directory .... tar zxvf nameofcoursebackupfile.mbz (.mbz's are really gzipped).
If it does that, appears to be a valid .mbz backup.
Throw that test away ... don't try to re-archive it.
Use your original .mbz file and try again.
When first seeing the screens that step you through the restore ... have your files browser opened as well ... see what's going on in moodledata/temp/backp/
If you have command line it's much easier.
What ever Moodle has used to create the directory ... like 'anasdfqwerads23qslsls'
watch "ls -lR anasdfqwerads23qslsls"
and in the terminal window you can actually watch what moodle is doing with that backup.
So .... ????? :\
Also, a server test ... upload the .mbz file to some work area on your server. Using your file browser/tool there is an extract and a compress button. Maybe you could use those to see how the .mbz actually extracts.
'spirit of sharing', Ken