Massive lag when changing diplomacy and unlocking Castle Age

I have created a scenario where you can ally villages.
When you ally them, they will ally you and your COOP player and unally 2 AI players.
Besides, the castle age becomes available for them.
They use the regular DE AI.

This trigger causes a MASSIVE lag only for the hosting player.
I wonder why? The AI starts building lots of buildings, sometimes like 10 docks, or 10 marketplaces.
Is there some issue when the AI registers that it has new enemies or can do things differently?

I would like to eliminate the lag since it is really annoying and we had to pause the game.