Submit is not working for contact form which was embedded by AJAX
I just had this issue myself. Try this:

use Drupal\Component\Serialization\Json;
use Drupal\Core\Render\BubbleableMetadata;

function somemodule_form_conditional_ajax($form, FormStateInterface $form_state) {
  $output = [];
  $values = $form_state-&gt;getValues();
  $conditional_form_id = $values['somefield'][0]['value'];

  $contact_message = \Drupal::entityTypeManager()
    -&gt;getStorage('contact_message')
    -&gt;create([
      'contact_form' =&gt; $conditional_form_id,
  ]);

  if (!is_null($contact_message) &amp;&amp; $contact_message instanceof Drupal\Core\Entity\EntityInterface) {
    $form = \Drupal::service('entity.form_builder')-&gt;getForm($contact_message);
    $output = render($form);

    $data = BubbleableMetadata::createFromRenderArray($form);
    $attachments = $data-&gt;getAttachments();
    $settings = '';
    if(!empty($attachments['drupalSettings'])) {
      $settings .= '&lt;script type="text/javascript"&gt;jQuery.extend(drupalSettings, ';
      $settings .= Json::encode($attachments['drupalSettings']);
      $settings .= ');&lt;/script&gt;';
    }

    $output .= $settings;
  }

  return $output;
}


The only thing I'm unsure about is if the $output requires an array - what I've given you is a string. So it may not work.