Hi ilippert,
please try this to get beyond the maintenance mode screen. Oddly this issue has been around since NextCloud 12 and we spent a fair amount of time to find the solution, too. Same issue occurs also in docker when installing a fresh instance or upgrading. This solution was found in the German NextCloud forum.
On a regular/local server enter these two commands:
chmod 700 occ
sudo -u www-data ./occ config:system:set overwriteprotocol --value="https"
If your NextCoud is runing on Docker it’s just one command:
docker exec -it -u www-data NAME_NEXTCLOUD_CONTAINER bash -c './occ config:system:set overwriteprotocol --value=“https”'
Reference to the original German post with solutions in last two posts of the thread: Zugriff gewähren lädt ohne Ende