dynamic route not updated
To update the routes you have to call RouteBuilder::rebuild:

\Drupal::service('router.builder')-&gt;rebuild();


This is not what you want to run very often during normal operation of the site. This can take several seconds. It's also not possible to run more than one update process simultaneously. So routes are in general static, even the dynamic ones.