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 org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.MappingMetadata;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.Randomness;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.index.query.GeoBoundingBoxQueryBuilder;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.InternalSettingsPlugin;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentFactory;
import org.elasticsearch.xcontent.XContentType;
import org.hamcrest.Matchers;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_NESTED_FIELDS_LIMIT_SETTING;
import static org.elasticsearch.index.mapper.MapperService.INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits;