I had a similar issue, which was caused by the fact that I wanted to break a list of unique items into blocks for parallel processing. My solution was the HashSet Chunk command, which eliminated my need for removing items from the HashSet entirely.