Its common on templates to transclude themselves as an example in the "noinclude" section.
Of course this self-transclusion uses the previous version of the template, because the template page isn't inserted in the db yet at render time on page-save.
We should mark such pages as "Vary-revision" so that such pages render correctly without requiring a manual purge.
(This of course won't really help circular dependencies, but those aren't common, and you can't fix everything).
Assigning to self as I eventually plan to do this at some point, and this bug is meant as a reminder since I usually forget things I plan to do. However if someone's bored and wants to do this themselves, don't hesitate to fix the bug.