It is possible to use DistanceSortField on non existent or non spatial fields without warning or error. From SpatialIndexingTest:
where NonGeoPOI looks like this:
The test refers to a field location which does not even exist. The code does neither fail or log a warning. The projected distance value is constant for all indexed points.
One could try to verify whether the field exists using the meta data, but this requires that the targeted entity is known. What would one do, if all entities are targeted? Does this even make sense?