[TwigBridge] fixed form rendering when used in a template with dynamic inheritance
merged branch fabpot/twig-form-renderer-fix (PR #9010)

This PR was merged into the 2.2 branch.

Discussion
----------

[TwigBridge] fixed form rendering when used in a template with dynamic inheritance

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #5284
| License       | MIT
| Doc PR        | n/a

Commits
-------

4c1dbc7 [TwigBridge] fixed form rendering when used in a template with dynamic inheritance