OK, i think the thing is you are trying to put HTML (comment in this case) outside of {% block %} definitions.
It seems this is possible when using embed but not with extends. If you read the Twig docs, embed is a kind of mashup of include and extends. It seems to have more leeway on where is a valid place to put markup.
Really this is a Twig error, and although i’m pretty competent, there are still things about Twig I have to learn!