I am on Bedrock on Xbox one, and Windows on PC. v1.18.31 and a few minor patches after the main big update. This started a week ago maybe a few weeks at most.
It seems to be that the realm is not saving specific data about the world we use. Or that the realm is not letting the information upload when it brings up a save once we get on. Whenever the realm goes offline, (as in no one is on, so it saves the world and takes it off an active server) then uploads the save onto the realm, when a player gets back on. There will be things that did not save usually /gamerules and player data like the players /scoreboard scores.
/gamerule commands I use on the realm
Specific game rules will be reset every time without fail. This is just the main part of what seems to be the overall bug that is going on. I use...
/gamerule doinsomnia false
/gamerule sendcommandfeedback false
/gamerule commandblockoutput false
All normal 'in settings game rules' seem to save fine. (The ones you can change manually in the settings menu on worlds normally.)
[As for the /scoreboard scores.]
We have also had all the players score info just not come back once the world comes back online. We use many scores, and all players will have no scores on them at all. This specific bug does not happen every time.
[Commands]
Sometimes command functionality is just turned off all together, after we get back on. This only happens every once and awhile. But is destructive to my world given how many commands I use to keep things working.
[Other info on my realm's world that maybe relevant.]
-Default game mode is Survival. Some players in creative.
-Normal difficulty
-53 realm members currently (Most inactive) but have probably had hundreds come onto the realm over the years.
-Realm is up and active most hours. Maybe no one online once every other day.
-ChromaHills HD texture pack
[Video of me testing the /gamerule bug]
https://www.youtube.com/watch?v=IS1rxsel4aw
Related issues
Comments


https://www.youtube.com/watch?v=IS1rxsel4aw
Should work now, meant to make unlisted not private.

Thanks, we can view the video now. Does the problem still happen if you download the realm world and open and close it locally?

No. Just tested that now to be sure.
I have also tried downloading the world, sending the commands on a local version on PC, then uploading the save onto the realm and it still will have the gamerules reset.

To be specific, I feel like this is a leak in the games ability to save data.
On PC, I also had the same world not save recent changes to areas when I left and came back to those areas. Though I was going back and forth via TP and it only stopped doing that once I left and got back on, on Xbox one. And I have not seen it happen again for sure. But I also play it much less on PC.
Also, for a while, maybe even since the last big game update with caves and cliff's part 2 I think, we have been having containers occasionally reset to how they were hours before. Making it so if we take things out, they may be in there again after we get back, or if we put stuff in and check later the stuff we put in it will be gone.
Those problems have not been the worst do to us being able to just use creative to get them back if needed.

This can be confirmed by multiple people on REALMS-10112

Does this happen with vanilla realms, or only with specific addons?

I only use the texture pack. No mod like addons. Though the texture pack is HD and effects a couple mob models. Otherwise, I do not know. I have not tried to remove the texture pack, nor would I do so to fix this problem. Given it is something I require for the world to work as intended visually.

Happens to vanilla realms as well.

Thank you for your report!
We're tracking this issue in REALMS-10030, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

I am consistently also having this issue for playersSleepingPercentage and it is really annoying to have to reset it every day. It makes me want to go back to using a mod for it, but then it considers it "cheating" and you can't get advancements.
The video is marked as Private so we are not able to view it.