To fix that error, try adding the scheme to the url. So if your remap command was
discourse remap talk.foo.com talk.bar.com
instead try
discourse remap https://talk.foo.com https://talk.bar.com
Uploads no longer use the full URL, they’re something like . Links do use the full domain as that’s how most people insert them into the composer, by pasting an absolute URL.