BUG: Bug in repeated indexing of object with resultant non-unique index (GH5678)

closes #5678