Thanks to procmon (as suggested by @Ahmed AEK) I found out that python 3.9 looked for dependancies in more directories than python 3.10 even though the PATH environment variable are the same for both python versions.
My .pyd files depends on a dll located in the parent directory. This directory is in the the PATH variable environment but python 3.10 ignored it.
I added dllDir = os.add_dll_directory(parent_path)
before import_module(unitTestModuleName)
and now Python 3.10 finds my dlls.