<p dir="auto">I have a controller with the following code:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$form = $this
    -&gt;createForm(SurveyType::class, $survey)
    -&gt;add('submit', SubmitType::class, [
        'label' =&gt; 'Create',
    ]);"><pre class="notranslate"><span class="pl-s1"><span class="pl-c1">$</span>form</span> = <span class="pl-s1"><span class="pl-c1">$</span><span class="pl-smi">this</span></span>
    -&gt;<span class="pl-en">createForm</span>(<span class="pl-v">SurveyType</span>::class, <span class="pl-s1"><span class="pl-c1">$</span>survey</span>)
    -&gt;<span class="pl-en">add</span>(<span class="pl-s">'submit'</span>, <span class="pl-v">SubmitType</span>::class, [
        <span class="pl-s">'label'</span> =&gt; <span class="pl-s">'Create'</span>,
    ]);</pre></div>
<p dir="auto">When I go to the profiler, it throws an exception <code class="notranslate">Key "type_class" for array with keys "id, name, view_vars, children" does not exist in @WebProfiler/Collector/form.html.twig at line 460.</code></p>
<p dir="auto">So adding elements to the created form (not form builder) leads to this problem.</p>
<p dir="auto">Btw, is it a bad practice to add buttons (specific for controller action) in such a manner? I know that a can use inherit_data for the <code class="notranslate">SurveyType</code>, but it does not allow to have DATA events, which I do use in this particular case.</p>
<p dir="auto">Is this issue related to: <a href="https://github.com/symfony/symfony/issues/20698" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/20698/hovercard">Exception after 3.2 upgrade #20698</a> ?</p>
<p dir="auto">The issue occurs opening the Form panel in the Profiler.</p>