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.
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?