Programs like LyX use "certain" rerun statements in order to determine how many times to run the LaTeX PDF generator. This works fine with TikZ images as long as no overlays are used, but otherwise fails because there is nothing to indicate that an additional run is needed.
The problem, including a workaround and temporary solution, is described on the LyX list:
http://www.mail-archive.com/lyx-users@lists.lyx.org/msg97338.html
Could this (i.e. some kind of rerun statement) please be added to PGF/TikZ directly?
Fixed in CVS.