Why are elements of these swatch sets different?

Is it how the interpolation is computed, something about translating to LCH?

Code at:

I would expect the swatch sets to be the same but the first element is slightly lighter for many of the scales when using a .map function.

I switched to computing the domain simply from 0 to number of items and am able to get closer but in low quantities the middle swatches are still different:

Looks like there is an off-by-one somewhere, swatches(d3.quantize(scales[intScale], internalLocations.length + 1).slice(1)) seems to give the expected result.

Gives me: