Currently there is this restriction:
Because FailureDefinition could only be registered when Revit starting up, this function cannot be used after Revit has already started. Throws InvalidOperationException if invoked after Revit start-up is completed.
The request is to allow creating failure definitions at times outside of OnStartup, such as in the DocumentOpened event