The same happened to me 2 months ago on RPi4 and ncp (not docker). My system was installed on sd card, and data folder with database folder were moved to external hdd.
So I ran nc-init command from ncp-config to make a new clean instance, then also with ncp-config moved data and data folders to hdd, and in nextcloud added “external storage” to copy files to the instance.
I think after this step you can use your backup file. I didn’t try because as usual in such cases my last backup was made long time ago. Instead I tried to use old database to recover user passwords (because of tockens for different android apps) but without success. I found it easier to make new tockens for all 3 users of my instance.