if you get an error code for example 0x803F8001 could you please post it here it would help solve the issue
the reason that you are stuck in fly on the realm is because you are in spectator mode you can switch back to survival with the command /gamemode surival if you are admin on that account. if not you can run the command /gamemode surival [insert playername] on the admin account both account have to be online at the same time for this to work. it could also be that you pc account is just not athourized to join in survival mode that can be changed by the admin. the admin account is the account the realms was created by
do both minecraft accounts run over the same email?
try clearing the cache of the microsoft store or try reinstalling it
try reinstalling the launcher that fixes the issue most of the time
how did you purchase the game?