It could be that you're querying a virtual replica. If that's the case, your queries will be limited to 20k results.
If you're not querying a virtual replica, check the value that's been set for the paginationLimitedTo property. If you increase it to your full dataset, you should be able to paginate through all the data.