A resume re-ran page 1 and the dataset now has record id 1 twice. The write keys each record by its POSITION (len(store)) — every write mints a fresh key, so repeats pile up. Fix the write so re-processing a page is harmless.
The break is on line 10 — but read the whole snippet first.