Recently we have upgraded our system to 6.3 to 6.5. When we execute query using Querybuilder API it is giving double when compare with query execution with Query debugger/query performance tool. It is giving blank values when we use Querybuilder API.It is picking proper custom index also ,in our 6.3 instance it is giving proper result.
For instance, when i execute query
Query debugger/query performance tool(/libs/granite/operations/content/diagnosistools/queryPerformance.html) - the result is 145 in total
Querybuilder API giving result - 290 in total result for same query. out of which 145 it is giving proper result 145 with blank records.
Try reindexing that index. It helped resolve the case for one of my customers. They had somewhat similar scenario of migration from 6.3 to 6.5 and issues in retrieving the correct number of records using the QueryBuilder API with their custom index.