It looks like you can use variables within the include tag in the manner you describe. From the docs:
All tags have a set of attributes which are defined for each tag. Some of these attributes
are required. Also, many attributes support evaluation, meaning you can embed an
expression (using ${}) inside the attribute text:
<%include file="/foo/bar/${myfile}.txt"/>
My guess is that c.page_messages isn't an iterable of dictionaries at this point.