Replace $config_directories['sync'] with $settings['config_sync_directory']
Change record, "The sync directory is defined in $settings and not $config_directories": https://www.drupal.org/node/3018145
Change record, "The sync directory is defined in $settings and not $config_directories": https://www.drupal.org/node/3018145