How to redirect to external URL upon form submission
You'll want to use $form_state-&gt;setResponse() instead to utilize the TrustedRedirectResponse you're creating.

Something like this should work:

public function submitForm(array &amp;$form, FormStateInterface $form_state) {
  // Do form stuff...

  $myurl = "https://example.com/my/path?amount=33&amp;gift=0&amp;product_id=1";
  $response = new TrustedRedirectResponse(Url::fromUri($myurl)-&gt;toString());
  $form_state-&gt;setResponse($response);
}


This response may be cached depending on your page cache settings. If you need to change this behavior, you can modify the caching metadata. This should disable this type of caching completely for the response (not tested):

public function submitForm(array &amp;$form, FormStateInterface $form_state) {
  // Do form stuff...

  $myurl = "https://example.com/my/path?amount=33&amp;gift=0&amp;product_id=1";
  $response = new TrustedRedirectResponse(Url::fromUri($myurl)-&gt;toString());

  $metadata = $response-&gt;getCacheableMetadata();
  $metadata-&gt;setCacheMaxAge(0);

  $form_state-&gt;setResponse($response);
}