API get contacts issue

Your software
My Mautic version is: 4.4.9
My PHP version is: 7.4.14
My Database type and version is: MariaDB 10.3.39

Your problem
My problem is:
I’m using the mautic API to get all the contact of a user. The user has around 37810 contacts, and they are recovered in batch of 5000. However along the interactions, many users are being recovered multiple times (same contact_id and same rest of contact information), even though I am updating properly the limit and start parameters in the requests

At the end of the process no all the contacts have been recovered because even though 37810 contacts and recovered, many of them are duplicated.

These errors are showing in the log:

Steps I have tried to fix the problem: