The problem happens with the Certers (Miles, Niles, Giles) random event.
If the bot accidentally clicks on the NPC, an interface pops up that hides the NPC behind it. This means that the NPC dismisser can't interact with the NPC, causing the bot to be stuck forever.
05:39:19 DEBUG Npc...