I had this same problem, and it always was down to about 3 people left on the roof with no way of killing them so the quest would fail.
I noticed one flaw other than the map, in this case, is honestly that there are no projectile weapons you can buy from cities that can be equipped on your civilian outfit. I looked everywhere but ultimately had to rely on my troops throwing rocks, having no rocks myself and often the troops wouldn’t be engaged to throw unless they had been attacked, which wouldn’t happen since the enemies were stuck. Even then, the rocks really did nothing even when hitting the enemies on the roof. But still, it would be nice to have projectile or ranged weapons available when in civilian garb, since your civilian garb and weaponry are forced in this quest.