Another temporary workaround that works on Android devices:
Put phone in airplane mode before you start the game. The game will not crash when it can't connect to the realms.
Create new local world.
Turn airplane mode off and wait for the internet connection to be restored.
Go to the menu and click play on realm. Select your existing realm and which of the three slots do you want the new world to go to.
Without leaving the world, go to Minecraft Stories and opt out.
(I think the opt out option should be added to minecraft.net to make this process easier.)
Affects 1.20.80. A piglin will not switch weapon to enchanted gold (or diamond sword).