Dunno, may be related to the bot takeover event (bot being replaced by player). but is just a guess
What I do in these cases is having a global var that check if the hook event was already applied, and then ignore
Maybe this can help if you are having any bugs