This is designed to prevent people from jumping off structures, but I suppose it could work both ways:

See the horizontal fence to the right? The same (decorative?) metal spikes that currently stick out of pillars and walls vertically outside & around the keep could be added horizontally under the wall openings to make the angle impossible for upward travel. Also make it so defenders on the wall can't stand on these protrusions from the wall for a better AoA on targets below them. Essentially these spikes block upward angled movement but not any projectiles or players attempting downward movement from the wall.
Instead of changing the all stuff behind the gap closers again, maybe add a landscape obstruction that serves the same restricting purpose?
"You get that blithe assumption that the status quo will always remain - or that this guy is so bad he's got to go. Neither are necessarily true, nor necessarily false." - Michael Kozak