Might have been me? I posted a short while back about Arkham Knight, which I purchased at launch, going missing from my purchase history. The answer was to jump onto support and after some troubleshooting (including a console reset), purchase it again whereupon they issued me refund instantly. Frustrating that it happened in the first place but happy with how it was resolved.I can't find the post I'm thinking of but someone on here had a similar problem as you recently. Some problem that seems to affect certain 360 games IIRC. I believe support sorted it out for them.
I understand you're upset but from your posts it sounds like you didn't even contact support channels to understand what had happened?Absolutely awful experience and probably put me off purchasing anything else on the series X and will only use it for Game Pass.
This may be a billing issue where your payment provider refused the sale after it completed and the licence was revoked. Or it could be a genuine issue on the Xbox marketplace side.
The important thing is speak to someone who can resolve the issue for you (the Xbox support team) and get the issue resolved rather than swear off buying anything ever again. Not only does this get the issue resolved for you, if there is a genuine problem on the back end there's a chance it gets identified and fixed so it doesn't happen again for anyone else.