Indeed, createIterationOnPattern was not designed to handle input nodes so the uniqueness of input identifier is not checked, but this could be seen as an issue, and we should fix it.
However, when you create an input/output node, the API, as SD does, ensures that you have unique identifiers and add a suffix to the provided identifier if necessary. So you can have a loop for creating input nodes without caring for unique identifiers on your side.