Create a custom fieldset template Normal scenario
In a custom form (created using FAPI) I have a fieldset definition:
$company_field_set = [
  '#type'  =&gt; 'fieldset',
];

If I would like to customize the fieldset template, I normally would create a hook_theme_suggestions_HOOK_alter function to add suggestions and then overwrite the template.
Alternative
I was wondering though why I wouldn't simply use the #theme key, so I tried this:
$company_field_set = [
  '#type'  =&gt; 'fieldset',
  '#theme' =&gt; 'my_custom_company_fieldset',
];

This does indeed render my custom template instead of fieldset.html.twig, but I don't get any variables in it. I would expect it to behave just like fieldset.html.twig.
I have tried several theme definitions:
// Same as default fieldset
'my_custom_company_fieldset' =&gt; [
  'render element' =&gt; 'element',
]

// Another tryout
'my_custom_company_fieldset' =&gt; [
  'render element' =&gt; 'children',
]

My template currently looks like this:
{% extends 'fieldset.html.twig' %}

I also tried:
{{ children }}

I see the template contents (like static text and such), but no variables.
I think I know a little bit too little about this and am missing something somewhere.
Could anyone point out my mistakes and/or tell me whether or not this is even possible?
After looking a little deeper in the Drupal core I found out that in this case I shouldn't overwrite #theme, but use #theme_wrappers instead.
So my theme definition:
function mymodule_theme($existing, $type, $theme, $path) {
  return [
    'my_custom_fieldset' =&gt; [
      'render element' =&gt; 'children',
    ],
  ];
}

In my form:
$form['some_fieldset'] = [
  '#type'  =&gt; 'fieldset',
  '#title' =&gt; 'Some title',
  '#theme_wrappers' =&gt; ['my_custom_fieldset'],
];

$form['some_fieldset']['some_field1'] = [
  '#type' =&gt; 'textfield',
  '#title' =&gt; 'Some title',
];

$form['some_fieldset']['some_field2'] = [
  '#type' =&gt; 'textfield',
  '#title' =&gt; 'Another title',
];

And then my template my-custom-fieldset.html.twig:
&lt;fieldset&gt;{{children}}&lt;/fieldset&gt;

Or for example:
&lt;fieldset&gt;
  {{ children.some_field1 }}
  Some customization here
  {{ children.some_field2 }}
  Something custom here
&lt;/fieldset&gt;