This issue is described in SAP Note: 2956817. Here is SAP's description of the error:
As per our developers, the error occurs from within OS. Below are some of the solutions we have offered in the past for this error.
1. Restrictive configuration under user profile.
Check the configuration under gpedit.exe → User Configuration → Administrative Templates → System → User Profiles. Make sure that there are no restrictive configuration
2. Slow workstation.
In general, Workstations that has a slow response for any operation on the operating system. Make sure the workstation is correctly sized considering all installed software.
3. Add-on using multithreading and make UI-API connections.
Multithreading is not supported for Business One SDK. [This is not something we do in the Boyum Add-ons during this connection phase].
And from our experience, it can be caused by:
4. Corrupted DI-API installation
Please re-install the same bit (32/64) DI-API that the SAP Client is that generates the error.
If you need more info then please contact SAP Support with reference to the SAP Note.