@Simon Aebi Based on my research, if we run script in a 64-bit Powershell host on a 64-bit client architecture, we can set "Run script in 64-bit PowerShell host" as Yes:
https://learn.microsoft.com/en-us/mem/intune/apps/intune-management-extension#create-a-script-policy-and-assign-it
Meanwhile, find an article mentioned to write registry keys in x64 hive and not WOW6432Node. We can read it for the reference.
https://oliverkieselbach.com/2017/11/29/deep-dive-microsoft-intune-management-extension-powershell-scripts/
Note: Non-Microsoft link, just for the reference.
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.