Run the following command in a singleplayer world:
/data modify storage test_world:storage test set value 0
Upon saving & exiting the world, the above command will create the following file in the world save's "data" folder:
[media]Upload this world to Realms. Then run the following command in the world in Realms:
/data get storage test_world:storage test
You may find that it is no longer set to 0. Then download the world again, and in the "data" folder in the world save you may find this:
[media]This is because my Realm was named "hi" and the world was named "World 1". It seems to replace "world" in all file paths with the name of the Realm/world. (This also applies to data pack contents which are unzipped, for example, which has led to any data packs with "world" in any of their file names being broken.)
Man I suck at making good reports lol. Need to be better at it soon.
Hope this is the only Realms bug. I haven't used Realms in years now.