Out of curiosity, in case you wanna do it with ffmpeg and/or Avisynth in the future, can you upload a very short sample of the original JPEG 2000 XYZ file or just a few screenshot that are in XYZ?
I was thinking about making a matrix of linear transformation (LUT) from your XYZ, output a regular BT709 Linear and add it to my free public
LUT Collection.