Just as a shot in the dark:
I honestly do not know, how the Excel UDF interacts with Exel.exe, but, maybe: For a complete different task with Outlook (powershell) I ran into the issue, that Outlook is opening a "COM-Server", and with that one the PS-Commands interact.
Sometimes it did work, next day it didn't. The constraint finally was, that outlook.exe can open such a COM-Server exactly one time within a Windows PC / VM. I used Fast User Switching (FUS), and when I had two logins to this test-PC, and under the login context of "User-A" there was outlook running, then after FUS to user-B the first instance of outlook.exe was not able to create a COM-Server within this user context again, because this is a "one-COM-server-per-PC" thing, not "one-per-user-context".
Switching back to user-A, terminate Outlook.exe there, switching again to User-B, everything was working perfectly.