I'm fairly new to Drupal (and to programming in general), and have written a custom module to implement a calendar.
This module also creates taxonomy terms during the installation, and those terms have a custom field for a css value.

When I install the module manually after Drupal is installed, the terms get generated correctly and the css field gets populated with a value. All is well.

But if I export the config of the module to be installed during the initial installation process of a new site (drush site-install ... --config-dir=../config/sync), the module is installed and the terms are generated, but with an empty css field.

Any idea why that is? Dependencies?

The relevant part of my .install file:

function my_calendar_install() {

  $term = Term::create(array(
    'parent' => array(),
    'name' => 'Schultag',
    'vid' => $vocabulary,
    'field_css_class' => 'someValue',
    'weight' => 1,