Changing scene from AR to VR

How do we change the scene from AR to VR and vice versa? I am new to unity and I’ve tried using the script below but not able to do so. I’ve created both the AR and VR scene already, I am trying to create a virtual button in the AR scene that allows me to switch the scene over to VR when it is triggered. I hope to get some help, thank you!

I also have the same problem, but it hasn’t worked, i tried to use XR setting, but when i open VR scene the problem is there.