The Gemara Brachos 29 tells us that Yochanan Kohain Gadol at 80 years old went off the Derech and became a צדוקי. How does this jive with the Gemara in Yuma עברו רוב שנותיו ולא חטא, שוב לא יחטא - 38 - that if someone passed through most of his days without sinning we are certain he will not sin?
The Lubavitcher Rebbe quotes a Midrash (and Rashi) who say that Hashem never calls himself after a Tzaddik in his lifetime as he "is not sure" that the Tzaddik will not go off the Derech.
By Yitzchak, however, Hashem did attach his name, as "he was blind which is considered like dead. Since he was hidden in his house, his Yetzer Hara left him".
The Lubavitcher Rebbe asks on this Rashi as to how can one say that since he is blind he will not sin, as many blind people do sin?
The Lubavitcher Rebbe answers that since Yitzchak's blindness was caused by his spiritual level (that his physical body couldn't handle Idolatry, as it was unlikely that the wives of Eisav would burn incense to Idolatry when Eisav was trying so hard to fake being a Tzaddik), therefore, under normal circumstances it would be highly unlikely that he would sin.
So too here, one could say that once someone passed half his life without sinning, most likely he would continue that way and not sin. However, if he is so inclined, he still has free choice.
The Gemara there uses, as a prooftext for this, the verse (I Sam. 2:9), רגלי חסיד(י)ו ישמר - Hashem guards the steps of His pious ones.
But after all, when you put up a fence (or a human watchman, or whatever) to "guard" something, it doesn't absolutely prevent something untoward from happening; it just makes it less likely. All the more so here, since fear of Hashem is the one thing that Hashem leaves out of His control anyway (הכל בידי שמים חוץ מיראת שמים, Berachos 33b). So the שוב אינו חוטא may simply describe a likelihood rather than an ironclad guarantee.
(There is also this point worth noting: in Kiddushin 66a, where the story of Yochanan's* becoming a Tzeduki is recorded, it mentions that one of the guests at that fateful party was "a scoffer, with an evil heart, a wicked man, named Elazar ben Po'era" - and he's the one who precipitated the crisis with his advice. We may well ask, then: what is such a character doing in Yochanan's inner circle anyway? That may well indicate that indeed a certain rot had set in long before.)