Sometimes a SCAN..ENDSCAN needs help in resetting the workarea to the right one at the ENDSCAN where it's moving the record pointer. I've seen it go wrong in VFP 3,5 and 6. But never identified what I was doing to make it do that. Just adding a SELECT cured it.
Is it possible there is an index corruption, and you're not visiting the last record because of that?