Combine Nextcloud-Backup-Restore-master and Dropbox-Uploader

I am trying to combine Nextcloud-Backup-Restore-master and Dropbox-Uploader. The backups are stored in Dropbox, so when I want to restore a backup, I should copy the backup from Dropbox to the VPS

At this moment the backup application creates the backup and upload the file to Dropbox. That works well.
The restore application doesn’t work correct.
I will give some lines on my screen which - I think - give some errors:

Updating the system data-fingerprint...
Nextcloud is in maintenance mode - no app have been loaded

Done

Switching off maintenance mode...
Nextcloud is in maintenance mode - no app have been loaded

A part of my modified NextCloudRestore.sh:

# File names for backup files

# Copy backup from Dropbox to Nextcloud server
if [ -d "${currentRestoreDir}" ]
then
     rm -r ${currentRestoreDir}
# exit 1
fi
/root/Dropbox-Uploader/dropbox_uploader.sh download ${restore} ${currentRestoreDir}

# Function for error messages

....

# In this case the data directory is under the application directory,
# so this directory doesn't exist anymore
# echo "Deleting old Nextcloud data directory..."
# rm -r "${nextcloudDataDir}"
# mkdir -p "${nextcloudDataDir}"
# echo "Done"
# echo

.....

#
# Update the system data-fingerprint (see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html#maintenance-commands-label)
#
echo "Updating the system data-fingerprint..."
cd "${nextcloudFileDir}"
sudo -u "${webserverUser}" php /var/www/html/occ maintenance:data-fingerprint
cd ~
echo "Done"
echo

#
# Disable maintenance mode
#
echo "Switching off maintenance mode..."
cd "${nextcloudFileDir}"
sudo -u "${webserverUser}" php /var/www/html/occ maintenance:mode --off
cd ~
echo "Done"
echo

echo
echo "DONE!"
echo "Backup ${restore} successfully restored."

Can you help me to resolve the problems of the given error messages?

Kind regards,
Guido