I then did some digging and found that even when using game.ban_player banning was not possible. Here are all inputs tried for PlayerSpecification:
- "аграрный работяга" (the players name, after being copyied from the log file)
- 120 (the players index at the time)
- game.players[120] (the player userdata)
- game.players[120].name (the player's name via userdata)
![Image](https://forums.factorio.com/images/ext/7270783bacb2dce30377efd6d3262eeb.png)
The second half of the players name as be prefixed to the reason and if no reason is included in the command then the second half becomes the reason:
![Image](https://forums.factorio.com/images/ext/9e2064a149d64b611d153e42e8d8d235.png)