Sorting is possible on the fields of the datatype that set on the RG. The calculated data is not a field and hence is not available for sorting in the RG data source settings.
You can solve this issue by creating a field on the Thing you sort where you will temporary store the distance. You can populate the distance to this field automatically triggering by “When page is loaded” → make change to the list of things (here you indicate the expression that calculates the distance).