Message2 is not part of the iterator, it's just after it.
See how "Set Variable1" is indented under qi1? That's where you want Message2 to be. Then it will keep the value. You can drag the Message2 action onto qi to make it a child action.
Also, just FYI - if your query in the query iterator were to return multiple rows, then the actions indented under it would run once for each result from the query iterator.
There are a couple in there about automation designer. See the one called "Automation Designer - Choose which script to run based on a variable.docx" It has an example of Query Iterator.
We don't support setting of one variable from another.
I'll log it as a bug and will have it fixed soon.
In the meantime, just use the qi1.query_year variable in whatever action you need it. You can drag multiple actions under the query iterator if needed.