drupal force redirect in form code example
Example: drupal 8 form redirect
use Drupal\Core\Url;
// Url to redirect.
$path = '/my-path';
// query string
$path_param = [
'abc' => '123',
'xyz' => '456'
];
// Use below if you have to redirect on your known url.
$url = Url::fromUserInput($path, ['query' => $path_param]);
$form_state->setRedirectUrl($url);