Since Version 9 is the first one to no longer need realurl, there will be a need to debug the routeEnhancer in the core.
Very useful files are:
- typo3/sysext/core/Classes/Routing/PageRouter.php -> generateUri
- typo3/sysext/extbase/Classes/Routing/ExtbasePluginEnhancer.php -> enhanceForGeneration