Sounds like something within the application is trying to do something that Windows really doesn’t like. The application developer would need to review the code and figure out what what it’s doing wrong.
The classic way to get this error is to implement an error handler, but in the error handler the code does something which throws a further error.
<do something here that fails>
Any code in an error handling block needs to be “bulletproof” to avoid these kinds of errors – beware of trying to do any database statements, including rollbacks, inside an error handling block.