hi @hobbit3434 welcome to the forum
The error shows DNS resolution fails for whatever reason. your “regular” DNS resolution fails to resolve the public fqdn of the server you need to add the FQDN+IP to /etc/hosts. the hosts file you posted looks good IMHO but the question is if your cloud is using this hosts file (or another one if this is a VM/container). As your system architecture is still unclear for me I can’t recommend you how to solve the issue.
basic troubleshooting would be to run curl https://<cloud.domain>/apps/richdocumentscode/proxy.php?req=/hosting/capabilities
from the Nextcloud host/container/VM this is the step how Nextcloud learn the capabilities of the office server.
for general background information about the WOPI protocol and integration you might want to look at Collabora integration guide