I have a webform with the confirmation set to redirect to URL (redirects to a custom path or URL) In my webform handler, I have the following:
public function confirmForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {
$url = "https://SOMEURL.com";
$url = Url::fromUri($url);
$form_state->setRedirectUrl($url);
}
I verify with xDebug that $url contains a valid Url object with the correct value in its uri property, but the form then redirects to the path in the placeholder and not the new one.