I am having this same issue on Minecraft for Windows. I cannot click on the marketplace without the error "invalid session" - I also cannot load any skins.
This extend to in-game as well and I cannot do ANY /commands when joining someone else's game - no matter who hosts. All permissions are set correctly and I am not the only person I know personally with these exact issues.
I have tried:
Restarting the game
Restarting my computer
Logging out entirely from my Microsoft account and logging back in
Uninstalling and reinstalling the entire game
Clearing the cache (this SORT OF works - when I close the game and come back to it the error returns)
Hope this info helps! It's definitely frustrating and I never had a single issue with this game before I was forced to migrate from my Mojang account to a Microsoft account (because ofc).
Here's a screenshot of the error I get when trying to use commands - here I just tried "weather clear". Like I said, the permissions are all correct.
[media]My bad. Didn't mean to - thought I was doing something else.
I have been having this issue for over 6 months now with Bedrock - I can't use ANY commands and I cannot access the marketplace or change my character skin. I also cannot play any purchased worlds, which really sucks and is now a waste of money. It's super annoying because I do a ton of multiplayer with friends and they don't have this issue.