Let's say you continuously change wavelength of a laser from blue (~480nm) to red (~630nm), you are going through green, not through gray. If in your use case going through gray makes sense, that's ok, there may be many paths from one color to another.
In general people don't really think of color in terms of the spectral progression (or the hue wheel), and I don't think that most people intuitively expect a gradient between two colors to pass through another "unrelated" primary or secondary color. The point is somewhat moot though, given that such gradients (like yellow to blue or red to green) are very unnatural anyway.
I disagree somewhat. Color mixing just isn't particularly intuitive. It's not the most intuitive to get a third hue, but that doesn't justify grey (which has an undefined hue). I do think most people are quite comfortable with the fact that between blue and yellow exists green, but is it a saturated green or a desaturated green? Additive and subtractive color mixing behave very differently here.
It's funny and a bit sad because we just went througha decades-long effort to migrate away from jet/rainbow gradients to vik/batlow/bi-hue gradients, and now rainbow is forcing its way back.
Honestly I suspect this is largely a non issue. I have never made a gradient that goes through more than 2 different color (by some vague measure of different) without adding an additional stop. If I wanted to go through yellow and green to get to blue, I would add a stop at yellow and another at green, and I suspect most developers would do the same.
Is that not a transition through the color mixing (or overlay). I'm assuming the light sort of tails off as you leave the area of one color and head to the other (and the other color comes on with more intensity then).
I suppose that's different with light than some analog with pigments? (Two dabs of color set apart, a brush perhaps used to blend them as continuously as is possible.)
Your light thought experiment would produce a color gradient via additive color mixing.
A magenta to green gradient would then go through white rather than grey. A subtractive magenta-green gradient would go through black. Not sure what physical setup would produce the latter gradient. But the standard RGB (or OKLAB) gradient goes through grey rather than white or black. This type of gradient is physically created by dithering: Dithering a gradient from magenta to green, by just using these two base colors, would produce a perceptual grey in the middle. This type of color mixing is otherwise better known as alpha blending.