### Elasticsearch Version

8.10.3

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

docker

### Problem Description

Cannot sort by field if there are blank values
{
  "name": "es-1-master-2",
  "cluster_name": "es-1",
  "cluster_uuid": "kQ8-xy6FQeqjR8Zmc_a9HQ",
  "version": {
    "number": "8.10.3",
    "build_flavor": "default",
    "build_type": "docker",
    "build_hash": "c63272efed16b5a1c25f3ce500715b7fddf9a9fb",
    "build_date": "2023-10-05T10:15:55.152563867Z",
    "build_snapshot": false,
    "lucene_version": "9.7.0",
    "minimum_wire_compatibility_version": "7.17.0",
    "minimum_index_compatibility_version": "7.0.0"
  },
  "tagline": "You Know, for Search"
}

### Steps to Reproduce

Steps to recreate issue.
From kibana add sample data sets ['Sample flight data','Sample eCommerce orders']
Create dataview
name:test
index patter:kibana_*
timefield: --- I don't want to use the time filter ---

From discover sort by AvgTicketPrice, or run query
```
POST kibana_*/_search
{
    "sort": [
        {
            "AvgTicketPrice": {
                "order": "desc",
                "unmapped_type": "boolean"
            }
        }
    ],
    "fields": [
        {
            "field": "*",
            "include_unmapped": "true"
        }
    ],
    "size": 500
}
```
Can't sort on field [AvgTicketPrice]; the field has incompatible sort types: [LONG] and [FLOAT] across shards!

### Logs (if relevant)

_No response_
server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java
assertAcked(prepareCreate("old_index").setMapping("distance", "type=double", "route_length_miles", "type=alias,path=distance"));
        assertAcked(prepareCreate("new_index").setMapping("route_length_miles", "type=double"));
        ensureGreen("old_index", "new_index");
        List<IndexRequestBuilder> builders = new ArrayList<>();
        builders.add(prepareIndex("old_index").setSource("distance", 42.0));
        builders.add(prepareIndex("old_index").setSource(Collections.emptyMap()));
        builders.add(prepareIndex("new_index").setSource("route_length_miles", 100.2));
        indexRandom(true, true, builders);
        assertResponse(
            prepareSearch().setQuery(matchAllQuery())
                .setSize(builders.size())
                .addSort(SortBuilders.fieldSort("route_length_miles").missing(120.3)),
            response -> {
                SearchHits hits = response.getHits();
                assertEquals(3, hits.getHits().length);
                assertEquals(42.0, hits.getAt(0).getSortValues()[0]);
                assertEquals(100.2, hits.getAt(1).getSortValues()[0]);
                assertEquals(120.3, hits.getAt(2).getSortValues()[0]);
            }
        );
    }
    public void testCastNumericType() throws Exception {
        assertAcked(prepareCreate("index_double").setMapping("field", "type=double"));
        assertAcked(prepareCreate("index_long").setMapping("field", "type=long"));
        assertAcked(prepareCreate("index_float").setMapping("field", "type=float"));
        ensureGreen("index_double", "index_long", "index_float");
        List<IndexRequestBuilder> builders = new ArrayList<>();
        builders.add(prepareIndex("index_double").setSource("field", 12.6));
        builders.add(prepareIndex("index_long").setSource("field", 12));
        builders.add(prepareIndex("index_float").setSource("field", 12.1));