How can you prevent a Webform from going to a confirmation modal if remote post handler fails in a service response? I have a webform with a single handler - an extended remote post handler that sends the submission to an external service. The entire form loads in a modal dialog and has two wizard steps.
This service can return a 200 (with confirmation id and date) or 400 (and any number of errors).
How can I either:

Prevent the submission on error from the service, and reload the form to try again (with values retained)
Change the confirmation message to reflect that something went wrong, and either reload the form fresh with that appended or just have a link in the modal that goes &quot;back to form&quot;

I have looked at a few other questions like:

Trigger redirect after Webform Remote Post Handler posted successfully
How do I pass a response from a Webform custom handler back to Drupal to display on the confirmation page
Override webform confirmation and email message if token data is missing

I can't get them to work. preprocessConfirmation() is never triggered in my handler, I don't see other examples or where that would be called. How are we supposed to implement that effectively? If there was an error saving the data to the remote service, I either want the user to try again, or just delete the webform submission in Drupal and start over.
I believe it is too late to halt the Webform with validation errors once it is past the validation phase ie. in postSave(). If you are expecting validation errors on user input however, then you could move the service call to WebformHandlerBase::validateForm() and then save the service response in the $form_state object if you need it.
  /**
   * {@inheritdoc}
   */
  public function validateForm(array &amp;$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {
    parent::validateForm($form, $form_state, $webform_submission);

    try {
      $response = $this-&gt;doServiceRequest()
    }
    catch (\Exception $e) {
      $form_state-&gt;setErrorByName('foo', $e-&gt;getMessage());
      return;
    }

    // Save service response output.
    $webform_submission-&gt;setData($response-&gt;getData() + $webform_submission-&gt;getData());
  }

Note: This probably goes against the design of the RemotePostWebformHandler, but I think it could work..., or you could directly extend WebformHandlerBase instead.