Phalanx formations always run into a lot of trouble when going into tiny spaces (broken walls), or going into the city plaza. However, all troops have this problem (especially the city plaza), but the phalanxes more than most. Send in non-phalanx units to stall the enemy while you set up your actual attack force.