Can't submit data when rendering a webform programmatically I'm working on a Drupal 8 project, when trying to load a webform programmatically in a controller, the webform is rendered correctly but when data has been submitted no values founded on webform results page (still always empty).

Injecting the form in a paragraph as block and then submit data work perfectly, also submitting data from the webform node page works as it should (We can find data on form results page).

Here is my code:

MyController.php

namespace Drupal\my_module\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\webform\Entity\Webform;

class MyFormPage extends ControllerBase {

  public function content() {
      $webform = Webform::load('my_webform_id');
      $view_builder = \Drupal::service('entity_type.manager')-&gt;getViewBuilder('webform');
      $webform        = $view_builder-&gt;view($webform);
      return [
        '#theme'   =&gt; mycontroller_page',
        '#content' =&gt; [
          'title'     =&gt; t('I am a page from your controller'),
          'form'      =&gt; $webform,
        ],
      ];
  }
}


mycontroller-page.html.twig

&lt;article&gt;
  &lt;h1&gt;{{ content.title }}&lt;/h1&gt;
  &lt;div&gt;
    {{ content.form }}
  &lt;/div&gt;
&lt;/article&gt;


Any idea about this behaviors?
Thanks
@see How to embed a Webform? 

I recommend using something like...

return [
  '#theme' =&gt; mycontroller_page',
  '#content' =&gt; [
    'title' =&gt; t('I am a page from your controller'),
    'form' =&gt; [
      '#type' =&gt; 'webform',
      '#webform' =&gt; 'my_webform_id',
    ],
  ],
];