Here are some causes for non-zero values that you expect to be zero. The most relevant to your problem are listed first.
Your synthetic raw does not account for the input color profile of the camera, which is based on how the specific colors filter in the Bayer matrix interact with lighting sources when photographing calibration targets (with a lens, which may have its own color shift). Here is the histogram and output with the D200 profile (using RawTherapee):
Compare with when no camera profile is used.
See RawPedia: What Are DCP Profiles and Why Do I Need Them?
Some people refer to how manufacturers design their cameras to render colors to deviate from "reality" in a pleasant manner as their "color science".
These are configured in cameras via settings often labeled "color profiles" or "film simulations". They often have names such as Standard, Neutral, Vivid, Portrait, Landscape, and Flat. Some raw processors may attempt to replicate these profiles in a layer of color modification separate from color-correction profiles, camera input color profiles, and color spaces.
The working color space may not match the output color space. Make sure the working and output color spaces match. If that is not possible, selecting a different conversion method may produce "better" results because out-of-gamut colors are converted differently by different algorithms. Here are histograms to illustrate:
Adobe RGB → sRGB:
sRGB → sRGB:
Less relevant possibilities:
Highlight Recovery using CIELab Blending can affect the colors at the bright end of the gradients. Other methods (Blend, Color Propagation, and Luminance Recovery) had no apparent effect on the gradients.
The demosaicing algorithm can affect interpretation of colors.
See RawPedia: Demosaicing
Some programs add noise or dithering when converting color from higher bit depths to 8-bit/channel.
... the red shift is towards the actual color of the "red" filter in a typical Bayer mask - somewhere between yellow and orange. – Michael C
Ideally, "pure" input colors would result in output colors that match the Bayer filter of the selected camera. However, in practice, that is not what happens.
The color shift appears to be caused by camera profiles used by the raw processors, along with other contributing factors. They are created by processing photographs of calibration targets, taken with real lenses, under different lighting sources, as described at RawPedia. So the color filter does contribute, to the extent that it is involved in profile creation. However, each program produces different output, so it cannot be said which, if any, of them shifted toward, or away from, the actual colors of the Bayer filter used in any particular camera.
Regardless of the actual color in the Bayer array, select a different profile, and the output colors change. Use a different program, which uses different profiles, and the colors change. Use a synthetic profile, and the colors may be entirely unrelated to any real Bayer array.
Yet another layer of color modification that dissociates the actual colors of the Bayer array from the output image is "color profiles", such as Standard, Neutral, Vivid, Portrait, Landscape, Flat, which some raw processors may attempt to replicate.