It might possibly be related to this issue:
I'm experiencing a similar random issue with a find based on a $variable failing intermittently - I'm using Open Directory external authentication in a multi file solution.
I looked into that issue, and while it appears similar it is different. Our $variable is being set correctly, the perform find seems to be running too fast and fails. You can run the exact same string on multiple login attempts and sometimes it correctly finds the record, other times it fails.
It looks like it is definitely a server 14.0.4 issue. It doesn't affect our 14.0.4 users, only older 14 or 13 Pro Advanced users.
Hopefully these issues will get corrected with an update.
Thanks for your help!