1.18 (Bedrock), 1.19.11 Hotfix (Bedrock), 1.19.20 (Bedrock), 1.19.21 (Bedrock), 1.19.31 (Bedrock), 1.19.83 (Bedrock), 1.20.0 (Bedrock), 1.20.15 (Bedrock), 1.20.41 (Bedrock)
Steps to Reproduce
For the purposes of these steps we will be using the 'doinsomnia' game rule as an example. You can use any game rule that is NOT in the world settings UI for this test.
1. Enter a Realm with an existing world. Do not allow anyone else to connect to the Realm while testing.
2. As an owner, type in /gamerule doinsomnia
3. Take note of the value that is returned (value is true by default)
4. As an owner enter the following command: /gamerule doinsomnia false
5. Leave the world and don't allow anyone else to connect to it during the test.
6. Wait 20 minutes for the Realm to be unloaded automatically by the server. OR close and re-open the Realm in the Realm subscription page.
7. Re-join the world after the world has been automatically unloaded by the Realms server.
8. Type in /gamerule doinsomnia and take note of the output.
While the world is active an owner will change the doinsomnia rule to false to prevent phantoms from spawning. During the session the rule will be in force until the world is unloaded either by everyone leaving and the server automatically unloading the world, or closing and re-opening the Realm through the subscriptions page.
If the owner re-enters the world, said owner will find the doinsomnia rule has been reset to the default state of true. The owner will also discover any other rule set using /gamerule has been reset to default.
Realm owner expects to see /gamerule changes to persist through sessions / reloads as they did prior to 1.18.10. For example, setting doinsomnia to false should remain false until someone such as the owner or an op were to change said setting.
Note: This problem only affects game rules changed with the /gamerule command. All players MUST be disconnected from the realm long enough for the world to be unloaded automatically by the server.
I have also attached a video demonstrating this (I cut out the 20 minutes of doing nothing waiting for the server to unload). So you must wait 20 minutes before re-joining the Realm.