If you use siege tower to go through yellow’s wall, the gate will stay locked. Therefore, you can’t go out after capturing the town.
The campaign has been made before the Siege Tower been added to the game, so the desginers didn’t expect that. I meet this bug before, since player cannot change the diplomatic stance, so I made a Mangonel to “Attack ground” at the gate to destroy it. (and I forgot to report this bug)
you can report this bug in “Report a bug”: