How to change HDRI SKY dinamiclly?

So, I have a project where I want to be able to change between many skys, and it’s made in HDRP so I can’t use the normal SkyBox aproach. I found out how to change the default HDRI Sky, but if try to do it in code, I get a strange ERROR.

Any ideas?

Declare:

public VolumeProfile HDRP_profile;
HDRISky HDRP_sky;
public UnityEngine.Rendering.CubemapParameter CustomSkyBox;

on awake:

HDRP_profile.TryGet<HDRISky>(out HDRP_sky);

when need:

HDRP_sky.hdriSky.SetValue(CustomSkyBox);