The OP was not asking for help on how to beat the fight, if I'm reading correctly - they were highlighting an issue in the AI behaviour - which is why it is in this section of the forum, and not General, or Gameplay Tips.
Ido, If you've still got a save file that you can replicate this issue from, I'd strongly recommend that you progress it tothe point where you've successfully stuck hideous laughter to Zhalk, and can create a save before the mindflayer has his AI hernia about it. Send that save file (the whole folder, including the thumbnail screenshot) to Larian's formal bug report form, here:
https://larian.com/support/baldur-s-gate-3#modalSadly, it won't be the last time you encounter issues with hanging AI, turn skipping, or other batty behaviour. We really don't know how much of it Larian has any interest in fixing at this stage, but the best we can do is continue to send formal bugs with replicable examples.