The include tag doesn’t support interpolation of parameters. Parameters are expected to be string literals (entities enclosed by single-quotes or double-quotes).
Uhmm, are you saying I can’t hand in an entity like I do? Cause that part works.
What also works is assigning last and first. Then they are also accessible from within the include:
{% assign first = forloop.first %}
{% assign last = forloop.last %}
{% include entity.json entity=entity %}