### Elasticsearch Version

v8.6.0

### Installed Plugins

_No response_

### Java Version

n/a

### OS Version

n/a

### Problem Description

There is a tokenization failure when using `BERT` tokenizer with the following configuration:

```
"bert": {
              "do_lower_case": true,
              "with_special_tokens": true,
              "max_sequence_length": 512,
              "truncate": "first",
              "span": -1
            }
```

With the text field: 

"One of the earliest legends that connects the Tower with a raven is the tale of the euhemerised mutually destructive battle against the Irish leader Matholwch who had mistreated the British princess Branwen. Branwen's brother Br창n the Blessed (King of the Britons) ordered his followers to cut off his head and bury it beneath the White Hill (where the Tower now stands) facing out towards France as a talisman to protect Britain from foreign invasion.[8] Please note that Br창n is the Welsh word for Raven. This fact makes clear the link between Br창n's head being buried beneath the site of today's tower and the importance of the continued presence of ravens."

Failure: 
```
'java.lang.IllegalArgumentException: startOffset must be non-negative, and endOffset must be >= startOffset; got startOffset=553,endOffset=552', 'caused_by': {'type': 'illegal_argument_exception', 'reason': 'startOffset must be non-negative, and endOffset must be >= startOffset; got startOffset=553,endOffset=552'
```

### Steps to Reproduce

 - Put any model using BERT tokenizer
 - infer with the above text

### Logs (if relevant)

_No response_
x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/BertTokenizerTests.java
"is",
                        "fun",
                        BertTokenizer.SEPARATOR_TOKEN,
                        seventhToken[i],
                        BertTokenizer.SEPARATOR_TOKEN
                    )
                );
            }
        }
    }
    public void testMultiSeqTokenizationWithSpanFirstInputTooLong() {
        try (
            BertTokenizer tokenizer = BertTokenizer.builder(TEST_CASED_VOCAB, Tokenization.createDefault())
                .setDoLowerCase(false)
                .setWithSpecialTokens(true)
                .setMaxSequenceLength(3)
                .build()
        ) {
            IllegalArgumentException iae = expectThrows(
                IllegalArgumentException.class,
                () -> tokenizer.tokenize("Elasticsearch is fun", "Godzilla my little red car", Tokenization.Truncate.NONE, 2, 0)
            );
            assertThat(
                iae.getMessage(),
                containsString(
                    "Unable to do sequence pair tokenization: the first sequence [7 tokens] "
                        + "is longer than the max sequence length [3 tokens]"
                )
            );
        }