CloudPlayer.connect(...) when you already know which server the player should join. The method expects the name registered on the player’s proxy, such as lobby-1—not the server UUID returned by Server.getServerId().
Transfer the player
Look up the player by UUID, confirm they are online, and connect them to the registered server name:PlayerTransferService.java
transfer(...) from your command or matchmaking flow and handle the result:
PLAYER_NOT_FOUND when its lookup finds no online player. If the player disconnects after that check, connect(...) returns CONNECTION_FAILED.
Connection results
If your plugin needs to find an available destination first, see Route players with autoscaling.