Rest api returns more commits than shown on gitlab(web)

We are filtering commits with rest api. We get the data of commits, branches, users, merge requests… through rest api and than show them in an app. We have a bug/problem where rest api returns commits that are not visible on gitlab(web), when looking through the project and branch, but they exist because gitlab finds them when we search with hash.
I am wondering what is wrong with these commits/api. In our database we store the data from restapi we have 10 commits on branch ‘test’ for some project, but on gitlab(web) there are only 6, in same timespan, project, branch.
Thank you for your time and your answer.