### What happened?

https://seleniumhq.slack.com/archives/C0ABCS03F/p1677391208456589

I'm using an invalid element locator (for testing purposes) and I'm trying to identify that element within a fluent wait
The fluent wait is ignoring some exceptions (not including org.openqa.selenium.InvalidSelectorException)
Expected Behavior: the invalid selector exception should be thrown immediately
Actual Behavior: it gets caught and rethrown recursively until a timeout occurs, and then a timeout is thrown with the cause InvalidSelectorException
Here's a gist with the fluentWait block, the expected exceptions block, and a screenshot from the throwable object.
https://gist.github.com/MohabMohie/6c4d16bfca0ad7b15c3e274b631ecdf9
Is this a bug or am I doing something wrong?

### How can we reproduce the issue?

```shell
https://gist.github.com/MohabMohie/6c4d16bfca0ad7b15c3e274b631ecdf9
```


### Relevant log output

```shell
N/A
```


### Operating System

Windows 11

### Selenium version

Java 4.8.1

### What are the browser(s) and version(s) where you see this issue?

N/A

### What are the browser driver(s) and version(s) where you see this issue?

N/A

### Are you using Selenium Grid?

N/A
assertThat(elements).hasSize(1);
    assertThat(elements.get(0).getAttribute("class")).isEqualTo("cls-!@#$%^&*");
  }
  
  @Test
  void testShouldBeAbleToFindASingleElementByXPath() {
    driver.get(pages.xhtmlTestPage);
    WebElement element = driver.findElement(By.xpath("h1"));
    assertThat(element.getText()).isEqualTo("XHTML Might Be The Future");
  }
  @Test
  void testShouldBeAbleToFindMultipleElementsByXPath() {
    driver.get(pages.xhtmlTestPage);
    List<WebElement> elements = driver.findElements(By.xpath("div"));
    assertThat(elements).hasSize(13);
  }
  @Test
  void testShouldBeAbleToFindManyElementsRepeatedlyByXPath() {
    driver.get(pages.xhtmlTestPage);
    String xpathString = "node()[contains(@id,'id')]";
    assertThat(driver.findElements(By.xpath(xpathString))).hasSize(3);
    xpathString = "node()[contains(@id,'nope')]";
    assertThat(driver.findElements(By.xpath(xpathString))).isEmpty();
  }
  @Test
  void testShouldBeAbleToIdentifyElementsByClass() {
    driver.get(pages.xhtmlTestPage);
    WebElement header = driver.findElement(By.xpath("h1[@class='header']"));
    assertThat(header.getText()).isEqualTo("XHTML Might Be The Future");
  }