The search for empty ID lists did not remove all matches:

Persons[0].ID = []
Persons[1].ID = []

With a forward loop from index 0 to Persons.length, Persons[0] matches and is spliced.
This makes Persons[1] the new Persons[0], and as loop continued it missed this result.
To solve this problem, we use a decrementing loop instead so that splice does not affect any yet-to-be-searched values and their indices.