See https://github.com/symfony/symfony/issues/18853 for details. This is a feature/bug of Symfony/Twig, so it will take some time to fix it. Meanwhile, let's add some warnings in the docs.
Actually, it's during cache warmup, not cache clear. Also, it should be made more obvious that running cache:clear actually triggers a cache warmup by default (i.e. without the --no-warmup option).
Closing it as "fixed" because the related Doctrine issue was finally solved. Thanks!
Most helpful comment
Actually, it's during cache warmup, not cache clear. Also, it should be made more obvious that running
cache:clearactually triggers a cache warmup by default (i.e. without the--no-warmupoption).