Custom form calls different form in modal, submit/ajax callback of second form not called
Since you're programmatically setting a modal with
$response-&gt;addCommand(new OpenModalDialogCommand($this-&gt;t('Test'), $modal_form, $dialog_options));

For the form that is in the modal, Drupal needs to know what URL it should post the AJAX to and be told that its an AJAX request because this only gets set automatically when the url key doesn't have a value.
  '#ajax' =&gt; [
    'callback' =&gt; [$this, 'submitModalFormAjax'],
    'event' =&gt; 'click',
    'url' = \Drupal\Core\Url::fromRoute('dms_gift_voucher.gift_voucher_cofirm_form'),
    'options' =&gt; [
      'query' =&gt; [
        FormBuilderInterface::AJAX_FORM_REQUEST =&gt; TRUE,
      ],
    ],
  ];


Side note: The above isn't needed with the HTML way of opening dialog boxes, had you done:
&lt;a class=&quot;use-ajax&quot; 
   data-dialog-options=&quot;{&amp;quot;width&amp;quot;:600}&quot; 
   data-dialog-type=&quot;modal&quot; 
   href=&quot;/dms_gift_voucher/form/gift_voucher_cofirm_form&quot;&gt;
   Should load Test webform in a Modal
&lt;/a&gt;

because it has the URL of the form and knows its an AJAX request from the class name.