If you look on the thing you sign when getting a steam account, you don't actually own any of the games. Just like the MMO's, you cant play them when steam or producer decides to shut them down.
That only gives you the client component though, which isn't very useful when the game servers shut down.
Most games these days don't have a self-hostable dedicated server.
In case of Steam/Valve specifically it happened a while ago with Counter-Strike: Global Offensive. Valve replaced it with Counter-Strike 2, and while GO's client is still usable, some of its online components are not.
It's only works because Valve probably have contractual obligations to not break online services for the game until console EOL. This can very well be the case if it was ever possible to actually buy it on Xbox.
That's how publishers want thingns to work. But if the store interface gives one impression and the smallprint annother thne it's not clear that the contract is what courts will uphold.
It is worth noticing though that Steam has stopped using the word "Buy" and instead use terms "Add to Cart" and "Continue to payment" which are perhaps more ambiguous but still not much so IMO. They did however use "Buy" in the past and changing the store interface now should not excempt them from fulfilling the expectations they have set in the past.
ToSes aren't legally binding when they require you to waive your rights. This has been tested in courts repeatedly.