I tested your little script and ... yes it happend to me. See the attached files for the different results using V9SR6 and V10SR1.
For my oppinion, the bug is in V9SR6 because the max() returns an integer. Or better: should returm an integer. If you convert it into a date, every thing works fine in both V9 and V10SR1. I verified this within your script.
P.S.: How long did you search for this, when your script worked always fine in V9? ;-)
41702.V10SR1.qvw 123.0 K