Looks like https://github.com/elastic/elasticsearch/issues/37898 but that issue has been closed for years so I'm opening a fresh one.

**Build scan:**
https://gradle-enterprise.elastic.co/s/apnlznuk3yp5q/tests/:server:internalClusterTest/org.elasticsearch.index.mapper.DynamicMappingIT/testConflictingDynamicMappings

**Reproduction line:**
```
./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.index.mapper.DynamicMappingIT.testConflictingDynamicMappings" -Dtests.seed=20124EB0BA787503 -Dtests.locale=ar-YE -Dtests.timezone=Atlantic/Cape_Verde -Druntime.java=20
```

**Applicable branches:**
main

**Reproduces locally?:**
Didn't try

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.index.mapper.DynamicMappingIT&tests.test=testConflictingDynamicMappings

**Failure excerpt:**
```
java.lang.IllegalArgumentException: mapper [foo] cannot be changed from type [long] to [text]

  at __randomizedtesting.SeedInfo.seed([20124EB0BA787503:42F708BE625A906B]:0)
  at org.elasticsearch.index.mapper.FieldMapper.checkIncomingMergeType(FieldMapper.java:377)
  at org.elasticsearch.index.mapper.FieldMapper.merge(FieldMapper.java:362)
  at org.elasticsearch.index.mapper.FieldMapper.merge(FieldMapper.java:57)
  at org.elasticsearch.index.mapper.ObjectMapper.doMerge(ObjectMapper.java:515)
  at org.elasticsearch.index.mapper.RootObjectMapper.doMerge(RootObjectMapper.java:213)
  at org.elasticsearch.index.mapper.ObjectMapper.merge(ObjectMapper.java:467)
  at org.elasticsearch.index.mapper.RootObjectMapper.merge(RootObjectMapper.java:208)
  at org.elasticsearch.index.mapper.Mapping.merge(Mapping.java:139)
  at org.elasticsearch.index.mapper.MapperService.mergeMappings(MapperService.java:366)
  at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:334)
  at org.elasticsearch.action.bulk.TransportShardBulkAction.executeBulkItemRequest(TransportShardBulkAction.java:368)
  at org.elasticsearch.action.bulk.TransportShardBulkAction$2.doRun(TransportShardBulkAction.java:219)
  at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
  at org.elasticsearch.action.bulk.TransportShardBulkAction.performOnPrimary(TransportShardBulkAction.java:286)
  at org.elasticsearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:137)
  at org.elasticsearch.action.bulk.TransportShardBulkAction.dispatchedShardOperationOnPrimary(TransportShardBulkAction.java:74)
  at org.elasticsearch.action.support.replication.TransportWriteAction$1.doRun(TransportWriteAction.java:214)
  at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
  at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
  at java.lang.Thread.run(Thread.java:1623)

```
server/src/internalClusterTest/java/org/elasticsearch/index/mapper/DynamicMappingIT.java
BulkResponse bulkResponse = client().prepareBulk().add(client().prepareIndex("index").setId("1").setSource("foo", 3)).get();
        assertFalse(bulkResponse.hasFailures());
        bulkResponse = client().prepareBulk().add(client().prepareIndex("index").setId("2").setSource("foo", "bar")).get();
        assertTrue(bulkResponse.hasFailures());
    }
    private static void assertMappingsHaveField(GetMappingsResponse mappings, String index, String field) throws IOException {
        MappingMetadata indexMappings = mappings.getMappings().get("index");
        assertNotNull(indexMappings);
        Map<String, Object> typeMappingsMap = indexMappings.getSourceAsMap();
        @SuppressWarnings("unchecked")
        Map<String, Object> properties = (Map<String, Object>) typeMappingsMap.get("properties");
        assertTrue("Could not find [" + field + "] in " + typeMappingsMap.toString(), properties.containsKey(field));
    }
    public void testConcurrentDynamicUpdates() throws Throwable {
        createIndex("index");
        final Thread[] indexThreads = new Thread[32];
        final CountDownLatch startLatch = new CountDownLatch(1);
        final AtomicReference<Throwable> error = new AtomicReference<>();
        for (int i = 0; i < indexThreads.length; ++i) {
            final String id = Integer.toString(i);
            indexThreads[i] = new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        startLatch.await();
                        assertEquals(
                            DocWriteResponse.Result.CREATED,
                            client().prepareIndex("index").setId(id).setSource("field" + id, "bar").get().getResult()
                        );
                    } catch (Exception e) {