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
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
public class DynamicMappingIT extends ESIntegTestCase {
    @Override
    protected Collection<Class<? extends Plugin>> nodePlugins() {
        return Collections.singleton(InternalSettingsPlugin.class);
    }
    @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/95047")
    public void testConflictingDynamicMappings() {
        
        createIndex("index");
        client().prepareIndex("index").setId("1").setSource("foo", 3).get();
        try {
            client().prepareIndex("index").setId("2").setSource("foo", "bar").get();
            fail("Indexing request should have failed!");
        } catch (DocumentParsingException e) {
            
            assertThat(e.getMessage(), Matchers.containsString("failed to parse field [foo] of type [long]"));
        } catch (MapperParsingException e) {
            
            
            
            assertThat(e.getMessage(), Matchers.containsString("mapper [foo] cannot be changed from type [long] to [text]"));
        }
    }
    public void testConflictingDynamicMappingsBulk() {
        
        createIndex("index");
        client().prepareIndex("index").setId("1").setSource("foo", 3).get();