Related to https://github.com/elastic/elasticsearch/issues/54096 but with different error.

**Build scan:**
https://gradle-enterprise.elastic.co/s/alacszij2iusu/tests/:x-pack:plugin:watcher:internalClusterTest/org.elasticsearch.xpack.watcher.test.integration.SingleNodeTests/testThatLoadingWithNonExistingIndexWorks

**Reproduction line:**
```
gradlew ':x-pack:plugin:watcher:internalClusterTest' --tests "org.elasticsearch.xpack.watcher.test.integration.SingleNodeTests.testThatLoadingWithNonExistingIndexWorks" -Dtests.seed=BBAB816FDB200A43 -Dtests.locale=ga-IE -Dtests.timezone=Asia/Tehran -Druntime.java=19
```

**Applicable branches:**
main

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

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.watcher.test.integration.SingleNodeTests&tests.test=testThatLoadingWithNonExistingIndexWorks

**Failure excerpt:**
```
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed

  at __randomizedtesting.SeedInfo.seed([BBAB816FDB200A43:697B0E71D50E75BF]:0)
  at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:728)
  at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:418)
  at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:760)
  at org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:512)
  at org.elasticsearch.action.search.AbstractSearchAsyncAction.performPhaseOnShard(AbstractSearchAsyncAction.java:326)
  at org.elasticsearch.action.search.AbstractSearchAsyncAction.run(AbstractSearchAsyncAction.java:262)
  at org.elasticsearch.action.search.AbstractSearchAsyncAction.executePhase(AbstractSearchAsyncAction.java:469)
  at org.elasticsearch.action.search.AbstractSearchAsyncAction.start(AbstractSearchAsyncAction.java:217)
  at org.elasticsearch.action.search.TransportSearchAction.executeSearch(TransportSearchAction.java:1041)
  at org.elasticsearch.action.search.TransportSearchAction.executeLocalSearch(TransportSearchAction.java:769)
  at org.elasticsearch.action.search.TransportSearchAction.lambda$executeRequest$6(TransportSearchAction.java:390)
  at org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:167)
  at org.elasticsearch.index.query.Rewriteable.rewriteAndFetch(Rewriteable.java:112)
  at org.elasticsearch.index.query.Rewriteable.rewriteAndFetch(Rewriteable.java:77)
  at org.elasticsearch.action.search.TransportSearchAction.executeRequest(TransportSearchAction.java:478)
  at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:277)
  at org.elasticsearch.action.search.TransportSearchAction.doExecute(TransportSearchAction.java:103)
  at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:86)
  at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
  at org.elasticsearch.tasks.TaskManager.registerAndExecute(TaskManager.java:203)
  at org.elasticsearch.client.internal.node.NodeClient.executeLocally(NodeClient.java:112)
  at org.elasticsearch.client.internal.node.NodeClient.doExecute(NodeClient.java:90)
  at org.elasticsearch.client.internal.support.AbstractClient.execute(AbstractClient.java:380)
  at org.elasticsearch.client.internal.support.AbstractClient.execute(AbstractClient.java:366)
  at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:34)
  at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:41)
  at org.elasticsearch.xpack.watcher.test.integration.SingleNodeTests.lambda$testThatLoadingWithNonExistingIndexWorks$0(SingleNodeTests.java:64)
  at org.elasticsearch.test.ESTestCase.assertBusy(ESTestCase.java:1136)
  at org.elasticsearch.xpack.watcher.test.integration.SingleNodeTests.testThatLoadingWithNonExistingIndexWorks(SingleNodeTests.java:62)
  at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
  at java.lang.reflect.Method.invoke(Method.java:578)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:48)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1589)

  Caused by: org.elasticsearch.action.NoShardAvailableActionException: (No message provided)


```
x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/integration/SingleNodeTests.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */
package org.elasticsearch.xpack.watcher.test.integration;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;