Templating is only supported by a limited number of cards.
Card-Mod uses Jinja templating, not the JS-style templating you have shown, but as far as I can see the Mini Graph Card does not support templating at all. However, if you use Card Templater the templated name will work.
Instead of placing the whole graph card into some other card, you may easily add any templated value to any element of the many-graph-card (like a name) by card-mod.
Go to card-mod thread → 1st post → link at the bottom → mini-graph-card → smth like “how to add additional info”.
Also, I know nothing about card-templater, but a similar config-template-card causes redrawing of the whole card when a monitored entity is changed. Hope that the card-templater does not do it, but anyway I would not place the whole graph into it just to add some additional info on the card.