The corCIEXYZtoCIERGB function matrix to convert from the CIEXYZ to the CIERGB colorspace is not the inverse of the matrix used in the analogous function. According to wikipedia the matrix used is wrong. I did the inversion by hand and used it instead of this function.
Changed the camera position according to the desired graph.