Simple example of validator returning FailResult throws Cannot extend enumerations error

I wondered if anyone could assist me I have a validator and whenever I return a FailResult , I get an error ‘Cannot extend enumerations’

Here is a basic example , can anyone suggest why I am getting an error

input_validator.py

    def _validate(self, value: str, metadata: Dict[str, Any] = {}) -> ValidationResult:
        return FailResult(
            error_message="Value must be exactly two words",
            fix_value="",
        )

I see my error
My issue was I was using
Guard().use(input_validator.InputValidator(on_fail=OnFailAction))

I should have used
Guard().use(input_validator.InputValidator(on_fail=“exception”))