Even if we do not add the feature in the collection multiple times we should skip it in the layers it was selected from. Maybe I overlooked something and your patch already handles this.