If you pass 3 parameters to the validator with the last one being errors
then the return code is ignored thinking that the Spring Errors is taking care of errors.
If you want to use the error code then just pass 2 parameter to the validator as
static final termsCheckedValidator = {termsChecked, command ->
if (!command.termsChecked) {
return ['required.termsChecked']
}
}
//messages.properties
registerCommand.termsChecked.required.termsChecked=blah