Fixed duplicate error message when client validation is enabled. Fixes #3740. [skip ci]