There’s a few seconds between everyone entering the portal and the game ending.
If someone starts connecting to the game in those seconds, then there’s nothing you can do anymore. Your bot will get replaced, the match will end as soon as the player properly connects to the game, and this will happen inbetween the bot disappearing and the new player spawning in.
Which means you lost whatever books that book was holding/that player should be holding.
You cannot tell me that is intended behavior.