HDRI Sky Cubemap won't update

I want to procedurally generate a cubemap and then assign it to a HDRI Sky when my scene loads:

void Start()
    {
            Cubemap cubemap = GenerateCubemap();
            HDRISky sky;
            if (vol.profile.TryGet<HDRISky>(out sky))
            {
                sky.hdriSky = new CubemapParameter(cubemap, true);
               // A simple sphere to test if my cubemap is generated correctly, does indeed work    
               testSphere.material.SetTexture("_Tex", cubemap);
            }
    }

However, the sky does not update in the scene, independent of the Update Mode setting of the HDRI Sky. It does however update to the correct sky when i change something in the script and Unity recompiles during play mode.

Fixed it by using sky.hdriSky.value = cubemap; instead