Hi,
I never had this error, but from what I see in the message: HRESULT, is telling me that Result is a windows handle. So could be that a certain handle is overwritten, or used by another thread (if your program is multithread).
I always liked to debug the 'seemignly random' errors from colleguas of me, to show them that there is no sutch thing as 'random'

But I have to cofess it is somethime difficult...
To begin with if you have multiple threads, go single thread and see if you have still the same problem. Then simplify until you have a demo with no more code to show the problem. By then you probably have found it yourself, but pleas feedback here
Sorry but that is really all the help I can give ...