Drupal 8 Custom Composite Entity Select Field
I think you just need to change...

'#type' =&gt; 'entity_select',


...to...

'#type' =&gt; 'webform_entity_select',


In the Webform YAML source editor we are hiding the 'webform_*' prefixes, within custom code they have to included.

@see https://cgit.drupalcode.org/webform/tree/src/Element/WebformEntitySelect.php