Office gives WOPI error

that is good but it’s only required from client and NC…

sounds like your CODE container can not access NC for some reason. first check could be curl https://cloud.domain.tld/status.php -v inside of CODE container… if this works I would follow the path of the outgoing request from CODE container to the internet, cloudflare, reverse proxy to Nextcloud container and check if the request arrives and if this is forwarded to the next station… your might have to increase verbosity to see successful requests… following this approach you will find the place where it fails and might see the reason why it fails…

look at Collabora integration guide for further details