As far as I can see https://docs.boltcms.io/5.0/configuration/introduction#dynamic-values-for-config-settings suggests non-existing functionality -- I've seen 2 questions about it on slack recently.
I'd suggest at least removing the part that speaks about usage in pages via twig from the docs, and maybe even the whole paragraph.
As far as I can see (by looking at Kernel.php) it might be possible to access a setting defined in config.yml from inside the symfony container using bolt.<your_var_name> if you are using $container->getParamter(), but the use of $config in code or twig is the Bolt config, and that one doesn't support env var substitution.