Hey!
Sorry for the late response. As support is peer-to-peer, many of community members are busy at this time of the year but I'm glad that you managed to solve your issue by yourself.
Errors with nextcloud is popular topic on this forum and usually when people encounter those, it's related to the provider misconfiguration. In your example, error 504 most likely have been caused by said server side misconfiguration as well.
In case you're free user there's little you can do about it, so moving to another provider is probably the best way to go, as you have discovered yourself.
For the sake of linking let me refer to other similar topics discussing Nextcloud:
Nextcloud error discussions
In any case, welcome to the forum and wish you happy new year!