Today I had the time to have a look at the problem I have to pass the value of the GD_LIB variable from CUPS to ghostscript: CUPS is setting this variable on its own and thus overriding my setting. 🙁
It seems CUPS is not checking if I have my own GS_LIB variable and adding its own path to the already set one. That is bad.