While testing my mod, I found a way to trigger this.

I had a formula with a division by zero. And this formula apply only at one point of the game.

As soon as the new turn will use the formula, it make an endless end turn.