I kind of gathered that's what you meant, but that doesn't make any sense if you think about it...
Basically what you are saying is that it gets 10 results based on the offset, and then sorts those values only... (So in theory, it woul dbe possible to miss data because of this sorting technique).
I have modded this very script for a Corporate Directory and it works just fine. The output of the script gives me a sort of 10 results and doesn't miss a name. If you sort the array AFTER you run the query, then yes, that's exactly what will happen, but if you add an ORDER BY clause to your query, then it works just fine.