I had a very similar problem. I only used dashes, which apparently are not allowed in variable names.
I know that this is an older question, and he has already received a sufficient answer, but it is closely related and comes with the search, so for the sake of posterity ...
{% include "partials/forum-panel-header.html" with forum-name="demo name" forum-thread-count="22" forum-post-count="30" %}
It was necessary to change the dash to underscores ...
{% include "partials/forum-panel-header.html" with forum_name="demo name" forum_thread_count="22" forum_post_count="30" %}
It would be nice to know this before I wrote many variable names this way, and I had to go back through all the attached files to fix them.
Of course, I could find the answer if I looked, but at that time I did not even realize that I needed an answer.
Well, then I found the answer (when I realized that there was a problem) to another post here that appeared in the search under this (which is why I wrote on this).
source share