The sensor dark current arises from thermal emission of electrons, so the sensor does produce signals when there is no light. As mentioned previously the dark current signals have a Poisson distribution. The dark current signals are typically subtracted off, sometimes using a dark frame (better) and sometimes using mean values. In either case the subtraction will produce some slightly negative values. These values will be small but can be quite different for the different channels so they may be very non-neutral. Since they are not the result of light falling on the sensor there may not be any combination of light wavelengths that could produce the signals.
To avoid clipping these signals many cameras add to raw images a black offset that is often significantly larger than the maximum negative excursion of the dark current signals. Then the offset value is encoded in the raw file to be subtracted when linearizing the raw file (hopefully using software that does not clip the resulting negative values).
But then the camera is used to capture scenes. In many cases there will not be any significant areas in the focal plane image that are so dark the light incident is insufficient to lift the negative values to positive. Camera flare helps with this. Usually negative values will only persist if the scene is quite dark and the signal gain (ISO setting) is set quite high so the noise excursion is amplified.
Generally, IDTs are designed to handle slightly negative values. There is no issue with applying a matrix to linear values that go slightly negative. However, the matrix can amplify further the unrealistically chromatic signals resulting from the random noise being different on the different camera channels. In some cases this can cause artifacts. Also, LUT-based IDTs may not handle negative values.
In these cases one thing to do is to soft-clip the very slightly positive and negative values to a range from very slightly above zero down to zero using a “toe” function. Another approach is to apply an offset to the camera signals just sufficient to make all values non-negative. Which of these is preferred is to some extent a creative choice. The first option will keep the signal linear to the captured light except at the very extreme low end of the signal range, compressing the extreme blacks (and noise). The second option will be like adding a bit of synthetic flare to the whole image, reducing contrast slightly but maintaining the separation of the extreme blacks. In either case this should be done to the camera signals either when creating the raw image or in the IDT after subtracting the black offset.
Also, as mentioned previously, negative values can result from the conversion of the camera signals to colorimetric (ACES) values, because of the fact that the camera spectral sensitivities are different from those of the eye. In this case, the negative values can be relatively large – too large to address using a toe function or offset. Some sort of gamut mapping is needed, but it becomes a camera and possibly image specific problem. Ideally the gamut would not be compressed except for when an ACES value outside the spectral locus is encountered. It is a useful fact that the colors on the spectral locus can each only be produced using one spectrum, so if one knows the camera signals that result from these spectra (i.e. the camera spectral sensitivities), one can map them exactly and not produce any colors outside the spectral locus. This requires a 2D LUT, though, and some method to smoothly transition to the interior gamut. For these reasons the exact spectral locus mapping is not widely implemented.