I’m under impression WOPI (underlying protocol of Nextcloud Office integration) only works with TLS/https which requires certificates etc… but I might be wrong…
I assume there is something wrong with DNS or routing between the systems… you need this
most likely NC or CODE can’t reach the other system using the exposed URL. See https://docs.nextcloud.com/server/latest/admin_manual/office/troubleshooting.html for troubleshooting guide and Docker Compose for Nextcloud + Collabora + Traefik? - #2 by wwe for docker specific Collabora example