Convert YCoCG to sRGB

Hi,
I am using the Niagara Sample RVT node to sample the BaseColor from a landscape and tint particles accordingly.

The RVT BaseColor uses the YCoCg color space.
If I use the SampleRVT node as is, the color it outputs is completely wrong.

I tried to apply a conversion fomula found in ColorSpace.ush

float3 YCoCg_2_LinearRGB(float3 YCoCg)
{
    float Y = YCoCg.x * 0.25;
    float Co = YCoCg.y * 0.25;
    float Cg = YCoCg.z * 0.25;

    float R = Y + Co - Cg;
    float G = Y + Cg;
    float B = Y - Co - Cg;

    float3 RGB = float3(R, G, B);
    return RGB;
}

but after that the color is even more wrong.
Gives me this color :
image
When it should be this:
image

also tried the formula on wikipedia, but doesn’t work either.
https://en.wikipedia.org/wiki/YCoCg

How can you convert this properly to be used in Niagara?

Thanks!