Fixes #5860 - correctly error on validation failure