Fixes #5860 - correctly error on validation failure

fixes #5860 - added test

fixes #5860 - really added test