User ID conflicts using APIs

Hi everyone!
I’m a developer and I started studying Mastodon’s API to develop an open source Python client for exercise
I was practicing with APIs and I’ve found out a strange behaviour, which is described below.

Reading the timeline, APIs returned me a pair (username@instance, userID) for toot’s author, for example (user1@instance1, 12345), but when I use the ID 12345 through APIs (over instance1) to check some information, it appears that ID 12345 refers to user453435 instead of user1.

Is it possible? It’s a weird behaviour!
And if it’s possible, why?

Thanks in advance!

Can you post the actual request you have done (with curl for example or something like python requests)?

Even through requests it occurs. To obtain the current timeline of a given instance, for example, I send a get requests at a given url https://instance.tld/api/v1/timelines/public.
Then I loop over the response json, and for each toot I check [‘account’][‘id’] and [‘account’][‘acct’] to extract some information to show in my app.

Let’s say that I’ve found that ID = 12345 and acct = example_account. If I search for https://instance.tld/api/v1/accounts/12345 it will say another_account instead of example_account.
This occurs for few accounts, but it’s a weird behaviour.