ToSes aren't legally binding when they require you to waive your rights. This has been tested in courts repeatedly.
Doesn't Steam actually let people keep a game in their Steam library even if the publisher takes down the store page for the game?
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.
Another point is that Steam DRM is a) optional b) unlike always online GaaS trivial to circumvent
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.