I had the same problem.
After the restore, it was no longer possible to log in.
It was because the folder /var/tmp/nextcloud was not in the backup.
So I created it again.
mkdir -p /var/tmp/nextcloud
chown -R nextcloud /var/tmp/nextcloud
chmod -R 700 /var/tmp/nextcloud
Important !!! You may have to adjust your:
chown -R nextcloud /var/tmp/nextcloud
chown -R your-nextcloud-user /var/tmp/nextcloud
After that, you can log in again.