Built-in CODE heavily relies on correct reverse proxy config - likely something is wrong with you overwrite* parameters (or proxy headers). Especially the error regarding http:// makes me think something is wrong with reverse proxy config.
this might help: Nextcloud Collabora integration itās mainly about dedicated setup but few hints address built-in CODE as well.