I took a look into global table of your RitnTeleportation mod via gvv GUI. (I didn't see your source code yet)
I found you used a variable in _G table as "variable can be changed during runtime", which is "_G.connected_players".
Using "_G" table for runtime variable space is NOT RECOMMENDED, I recommend you leave _G space modifiable only during lua file loading stage and "on_load, on_init, on_configuration_changed" event stage.
Use _G table as similar way to "constants", not "variables"
Reason why is that "_G" is not saved in savefile.
Only "global" is saved. New player always download "savefile" from host. Because of this, variables in _G changed during runtime can cause desync for new players.
Please see official documentation about global variables.
https://lua-api.factorio.com/latest/Global.html
"_G" is the another global variable space which saves your variables declared without "local " notation in front of line.
Try to move "connected_players" to somewhere under the "global" table object.
And then test again please.
You also can see your variable via command
/c __RitnTeleportation__ game.print(_G.connected_players)
or
/c __RitnTeleportation__ game.print(connected_players)
both commands are equivalent.