This can be accomplished via the validationMode support, see the docs here. As long as the user did not yet click submit, you can hand over ValidateAndHide. As soon as the user clicks submit you can switch to ValidateAndShow which is the default.
The posted code snippets look correct. Can you construct a reproducible example, for example by modifying the JSON Forms React seed, so we can check whatâs going on?