if your dGPU is gpu0, i believe that DRI_PRIME=0 is actually considered invalid, and the number has to be greater than or equal to 1. I imagine that this also holds true with DRI_PRIME=0!
Maybe you could try selecting by the PCI device id? This command (written by myself) should generate the needed environment variable:
sh -c "echo 'DRI_PRIME=pci-0000_'$(lspci | grep 'Navi 33' | sed -E --expression='s/:|\./_/g' | sed --expression='s/\s.*/!/')"
and this command (also written by myself) will generate the needed environment variable and then run a program (replace vulkaninfo --summary with your own command):
sh -c "DRI_PRIME=$(echo 'pci-0000_'$(lspci | grep 'Navi 33' | sed -E --expression='s/:|\./_/g' | sed --expression='s/\s.*/!/')) vulkaninfo --summary"
(see the first note in section 2.1 of this archwiki page for more information on this format of the environment variable)
If you use the environment variable generated with vulkaninfo --summary (or the second command, unmodified) and it only returns your dGPU in the “Devices” section, you have set this up correctly.
Edit to add: DRI_PRIME=0! is indeed not respected (DRI_PRIME=0! vulkaninfo --summary will return information about every GPU in the system, whereas DRI_PRIME=1! vulkaninfo --summary only returns information about one GPU)
Edit also fixed a typo and put code blocks around environment variables
Edit to add (the second): If for whatever reason you want to do this with your integrated GPU, you can replace 'Navi 33' with 'Phoenix1' in either command. I did this to test that I could indeed select the first graphics adapter on the system.
Edit to add (the third): It is probably better to use the DRI_PRIME=vendor_id:device_id syntax in case PCI bus ids change (for example DRI_PRIME=1002:7480!), as documented at Environment Variables — The Mesa 3D Graphics Library latest documentation