Nextcloud Office cannot open documents

for me it sounds the components are not reaching each other in the proper way. Maybe this troubleshooting steps are helpful:
https://docs.nextcloud.com/server/latest/admin_manual/office/troubleshooting.html

from your config.php it looks the system is behind reverse proxy but you are missing overwritehost and overwriteprotocol settings. maybe worth double check reverse proxy

maybe this thread helps you as well: