Two items at different paths like this can have the same name, but they should have different IDs.
Are you sure the IDs are exactly the same? Please share the output so we can take a look. Note that IDs are case-sensitive, and may differ from one another only by the casing, so you need to use case sensitive comparisons.