Find out where it happens
After the error, try another known working server for the same game. If only one community server fails, note the address and exact error. Ask the administrator which client and build the server is meant to support.
Check your Steam branch
Close the game, check for pending downloads, and open the Betas tab in Counter-Strike 2 properties. Use the public release for an ordinary CS2 server. If an organizer specifies a separate branch, confirm its name with them. Wait for Steam to finish downloading before reconnecting.
Verify local files
If the error affects multiple servers after an update, open Properties → Installed Files in Steam and verify the integrity of game files. If other servers work and one still reports the error, send its administrator the exact message, server address, and time of the attempt.