protected function bootFrontendController(?SiteInterface $site, array $queryParams): TypoScriptFrontendController
    {
        // disable page errors
        $GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_handling'] = false;
        $controller = GeneralUtility::makeInstance(
            TypoScriptFrontendController::class,
            null,
            $site ? $site->getRootPageId() : $GLOBALS['TSFE']->id,
            0
        );
        $controller->fe_user = $GLOBALS['TSFE']->fe_user ?? null;
        $controller->fetch_the_id();
        $controller->calculateLinkVars($queryParams);
        $controller->getConfigArray();
        $controller->settingLanguage();
        $controller->settingLocale();
        $controller->newCObj();
        return $controller;
    }