"The idea is that the city wall should face outside the city." - no. For barrier=city_wall idea is to differ lower and higher terrain level, it's not about inside/outside. And for current case (historic=citywalls) there is no difference in line direction at all. See https://wiki.openstreetmap.org/wiki/Tag:barrier%3Dcity_wall

