Why top-down deletion breaks silently
When you call sheet.deleteRow(i) on row 5, every row below it shifts up by one. Row 6 becomes row 5, row 7 becomes row 6, and so on. Your loop variable has already moved past the new row 5, so it never gets checked. If two matching rows sit back-to-back, you delete the first and skip the second every time. The bug is reproducible but easy to miss because the sheet looks partially cleaned.
The fix is to iterate from the last row upward, toward row 1. Deleting row 10 does not affect rows 1 through 9, so the loop index always points at valid data.