There clearly needs to be a law to make such things illegal. I've refused to take the discount on digital Switch games since Nintendo has clearly shown they are willing to shut down old servers and tell you to just buy your games again.
But there are some games that are digital only and I fear the next generation of games will be like Xbox. You buy a physical that does nothing more than connect to a server that downloads the game.
Perhaps legally allowing backups of games you purchased would help.