What’s the full path to the actual python executable it’s using?
Can you try printing this in Py3 in Fusion (without AYON):
import os
print(os.__file__)
It should print the path to the os package for the python being used. It’s more helpful than sys.executable because that return the fusion executable. Anyway, is the os pakage path inside the Python folder you expected it to be? Or is Fusion loading it from elsewhere? Pretty sure it tends to take it from /opt/ something something by default? (Try using that folder instead?)
I think another approach here is actually to do less and allow it. If you’re in a place where you can fully manage that the right Python is available to Fusion out of the box, then the FUSION_PYTHON3_HOME could essentially be avoided.
There is a caveat however that the Fusion integration currently does not allow to ‘disable’ that out of the box (so would need code changes) and there’s other logic that somewhat relies on the FUSION_PYTHON3_HOME to be set, like the auto-install PySide prelaunch hook. However, it may be argued that in a production environment where you’re managing Python environments anyway the install prelaunch hook wouldn’t really be needed either.
You might be better asking around on the WeSuckLess forums or the Blackmagic Design forums on what’s needed on Linux to point FUSION_PYTHON3_HOME to your /usr/lib64/python3.9
And a topic covering some Linux users doing similar things but they are all referring to symlinking things just to get Fusion to detect it - but I suspect since it does work for you without FUSION_PYTHON3_HOME it may be something else.
What I’d suggest at least is fiddling with FUSION_PYTHON3_HOME env var without AYON involved - just to ensure it’s not AYON doing something else and getting in the way there.
If set, the PYTHONHOME environment variable (or the explicit PYTHON3HOME and PYTHON2HOME if you have both installed) will be considered. To explicitly override the version used by DaVinci Resolve and Fusion Studio, you can set FUSION_Python3_Home (formerly FUSION_Python36_Home) to point to the base folder.
I wonder if it may also be worth giving e.g. PYTHON3HOME a shot. Anyway, give it a whirl outside of AYON - and try those forums.
The only other approach is to tweak the prelaunch hooks to completely skip working with AYON setting any Python 3 home variables, etc. - so that in your case you can just rely on Fusion’s default behavior of picking whatever it happens to find. Which one may argue could be more dangerous in a real-life production scenario.