SetDebugMode throws an exception

I’m using the LexActivator v3.32.3 x64_MT static library with Visual Studio v17.14.7 (64bit).
SetDebugMode throws an exception in the Visual Studio file fdopen.cpp at line 28.

_VALIDATE_RETURN(fh >= 0 && (unsigned)fh < (unsigned)_nhandle, EBADF, nullptr);

where fh = -1 and _nhandle = 64.

An exception is not thrown when reverting to the LexActivator v3.31.0 x64_MT static library with Visual Studio v17.14.7 (64bit). The log file is being created.

In the LexActivator change log it appears that v3.31.1 (2025-01-09) fixed a behavior issue with SetDebugMode.

Any idea as to what the issue was and what was changed?

Any idea on how to stop the exception being thrown in v3.32.3, ?

Thankyou.