When a search is performed not all records for a lastname are located.
Why would be the first question.
As for your question, if you have 10 or higher, you could use a script trigger to run your sort script.
I have seen this behavior when the index to a field was corrupted.
You might try re-indexing the field or importing your data into a clone of your file.
To re-index a field you simply set it's indexing option to off, close and re-open manage database, and then turn it back on.