Early in the game when you fight the orcs, shaman and ranger on the beach.
The shaman backed up real close to the city gate, My melee character followed and that seemed to prompt the encounter with the wizard. After the battle ended (the shaman died last), the conversation with the wizard started. After the conversation, the city gates hadn't opened and remained shut.