Change Current Render Engine to V-Ray using Python in maya 2022

Try to read the correct value when you manually switch to VRay:

print(cmds.getAttr("defaultRenderGlobals.currentRenderer"))

Then when you know the correct name, you can use it in your code:

cmds.setAttr("defaultRenderGlobals.currentRenderer", "vray", type="string")