I think it depends on the game and the activity. I agree games can be a great escape and a form of therapy and can help those with anxiety with focus and to cope with certain symptoms. But, certain game types can increase depression and self loathing thoughts and behaviors.
As an example, the game Destiny 2 has a PvP (player vs player) game mode called Trials of the Nine. Two 4v4 teams play to win. Now, this can be a great social event, help with cognitive thoughts and improve team playing. However, the online presence has seen some people receive messages from opposing players (“you suck”, “youre trash”, “kys”) such can (obviously) make someone with depression feel even worse than when they started.
Added to this the pressure to do well can make someone with anxiety or depression feel worse about themselves.
I think video games can be hugely beneficial, but the genre and game type definitely needs to be considered. Perhaps 1 player strategy games are best?