Wall.ByFace is only used with faces from a mass element.
You either need to use the geometry of the wall to make a mass and then get the faces of the mass. But that’s the long way around.
For vertical walls just het the location line of the wall as a line and use that to draw a new wall with the same height as the existing wall.
But wondering why you don’t just make a wall type with the correct material on the exterior(?) No code required.