The error code 31 seems to come from Windows. At least I can find exactly this error message "ERROR_GEN_FAILURE [code 0x0000001f]" on the Windows system error list:
System Error Codes (0-499) | Microsoft Docs
But the description of this error does not help much:
A device attached to the system is not functioning.
However, I would suggest that you investigate the error on the Active Directory system further. Maybe you can find more information in the Windows Event Log.