title: Drupal 9 - form in custom module using Controller - html tag form not present
body: <p>I'm trying to render limited user edit form on custom page using Drupal Controller.
  In the routing.yml I defined _controller, I do not want to use _form.</p>
  <p>I want to display on the form e.g. only timezone field, but not the rest. And I'm not able to achieve it. I can render this field, other fields like form_build_id, form_id, form_token
  But form html tag is not rendered at all.
  It works only if I display in twig whole form like this {{ form.form }}</p>
  <p>Here are my files:</p>
  <p>my_module.info.yml</p>
  <pre><code>name: 'My module'
  type: module
  description: 'my module'
  core_version_requirement: ^8.8 || ^9
  </code></pre>
  <p>my_module.routing.yml</p>
  <pre><code>my_module.mymodule_controller_view::
    path: '/my-module'
    defaults:
      _controller: '\Drupal\my_module\Controller\MymoduleController::view'
      _title: 'My module'
    requirements:
      _permission: 'access content'
  </code></pre>
  <p>my_module.module</p>
  <pre><code>&lt;?php
  
  function my_module_theme($existing, $type, $theme, $path)
  {
      $templates = array(
          'my_module_form' =&gt; [
              'render element' =&gt; 'form',
          ],
      );
  
      return $templates;
  }
  </code></pre>
  <p>MymoduleController.php</p>
  <pre><code>&lt;?php
  
  namespace Drupal\my_module\Controller;
  
  use Drupal\Core\Controller\ControllerBase;
  use Drupal\user\Entity\User;
  
  class MymoduleController extends ControllerBase
  {
  
      public function view()
      {
          $data['header'] = [
              '#type' =&gt; 'markup',
              '#markup' =&gt; '&lt;h1&gt;HEADER&lt;/h1&gt;',
          ];
  
          $user = User::load(\Drupal::currentUser()-&gt;id());
          $formObject = \Drupal::entityTypeManager()
              -&gt;getFormObject('user', 'default')
              -&gt;setEntity($user);
  
          $form = \Drupal::formBuilder()-&gt;getForm($formObject);
  
          $data['form'] = [
              '#theme' =&gt; 'my_module_form',
              'form' =&gt; $form,
          ];
  
          $data['footer'] = [
              '#type' =&gt; 'markup',
              '#markup' =&gt; '&lt;h3&gt;footer&lt;/h3&gt;',
          ];
  
          return $data;
  
      }
  
  }
  </code></pre>
  <p>my-module-form.html.twig</p>
  <pre><code>&lt;div&gt;TWIG TEMPLATE&lt;/div&gt;
  
  {{ form.form.timezone }}
  {{ form.form.form_build_id }}
  {{ form.form.form_token }}
  {{ form.form.form_id }}
  {{ form.form.actions }}
  </code></pre>
  <p>Thank you in advance for any hint.</p>