Programmatically creating a new instance of a custom content entity that contains a field collection
The bundle of the entity type "field_collection_item" is field_name and the error messages says this is missing:

$variation = FieldCollectionItem::create([
  'field_name' =&gt; 'my_field_name',
  ...