When a map component is connected to the Gradient input of the Elevation Gradient component, only the topmost pixel row of the image supplied by this input is sampled as a gradient. In a horizontally-oriented gradient, the topmost row of pixels is a gradient, so the result is a correctly colored elevation gradient:
In a vertically-oriented gradient, the topmost row of pixels is a single-color line, so the result is a solid-color field: