As far as I can tell, this bug only really affects worlds that have datapacks. You still get a 504 error uploading a world without datapacks, but usually when you log in it did in fact upload.
When you upload a world that has datapacks (any type) you get the 504 error, but when you try to log in it is a random new world. Notably the random new world will have all the data packs that were in the world that you just tried to upload.
Still no fix for this issue. We’re quickly closing in on a year since I was able to update my realm’s datapacks. If Mojang does not fix this issue soon, realms as a service is basically a scam.
I have unsubscribed from realms. This rather serious issue has existed for over a year without being fixed. There’s no point to keep giving Microsoft my money if they can’t even keep their (paid) service working correctly. I’ll figure out how to host my own server instead.