Array not following curve shape
The wall is not following the terrain because the curve has an unapplied modifier on it. You need to apply the shrinkwrap modifier to it. After you apply it the wall will follow the path like you expect.