Upgraded Drupal core from 9.4.7 to 9.5.8 as well as contrib modules, but upgradation of Site Settings and Labels 8.x-1.19 to 1.20 gave following error. While downgrading this module (only) back to 1.19 would give php warning.
Steps to reproduce
Composer update with dependencies.
The website encountered an unexpected error. Please try again later.
Error: Undefined constant Drupal\site_settings\SiteSettingsLoader::SITE_SETTINGS_CACHE_BIN in Drupal\site_settings\SiteSettingsLoader->loadAll() (line 60 of modules/contrib/site_settings/src/SiteSettingsLoader.php).
Drupal\site_settings\SiteSettingsLoader->loadAll() (Line: 75)
site_settings_preprocess(Array, 'field', Array)
call_user_func_array('site_settings_preprocess', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 110)
Drupal\Core\Entity\Controller\EntityViewController->buildTitle(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 243)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 116)
Drupal\cloudflare\CloudFlareMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
PHP warning after downgrading module to 1.19 on Drupal core 9.5.8
Warning: Undefined variable $cache in Drupal\site_settings\SiteSettingsLoader->loadAll() (line 62 of /var/www/html/web/modules/contrib/site_settings/src/SiteSettingsLoader.php)
#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'Undefined varia...', '/var/www/html/w...', 62)
#1 /var/www/html/web/modules/contrib/site_settings/src/SiteSettingsLoader.php(62): _drupal_error_handler(2, 'Undefined varia...', '/var/www/html/w...', 62)
#2 /var/www/html/web/modules/contrib/site_settings/site_settings.module(75): Drupal\site_settings\SiteSettingsLoader->loadAll()
#3 [internal function]: site_settings_preprocess(Array, 'field', Array)
#4 /var/www/html/web/core/lib/Drupal/Core/Theme/ThemeManager.php(287): call_user_func_array('site_settings_p...', Array)
#5 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render('field', Array)
#6 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender(Array)
#7 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
#8 /var/www/html/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array)
#9 /var/www/html/web/sites/default/files/php/twig/6450e63288741_paragraph.html.twig_I1mv5pZ60qEdrRw0kouePW1cQ/z7GqUwKde5wcQcCU2Kwk5NryDnd7RyLrIa2QODCXTEQ.php(70): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#10 /var/www/html/vendor/twig/twig/src/Template.php(182): __TwigTemplate_c625f61593775a36adc529464a39e327e990396b976dc4711a96d7417878e7c4->block_content(Array, Array)
#11 /var/www/html/web/sites/default/files/php/twig/6450e63288741_paragraph.html.twig_I1mv5pZ60qEdrRw0kouePW1cQ/z7GqUwKde5wcQcCU2Kwk5NryDnd7RyLrIa2QODCXTEQ.php(58): Twig\Template->displayBlock('content', Array, Array)