This occurs when we try executing a sort by distance on multiple indexes.
The source of the bug is obvious, but beyond fixing it, we should really add a test for distance sorts on multiple indexes.