I think you can make your color conversion more accurate by using hue-python-rgb-converter to convert your RGB values to CIE XY coordinates and then packing them into two 16-bit little-endian integers.
(See: https://github.com/alexhorn/libhueble/blob/main/src/__init__.py#L79)