### Description

This applies to the following APIs:
- [x] open anomaly detection
- [x] start datafeed
- [x] start data frame analytics job
- [x] start trained model deployment

Currently, if the operation takes longer than the configured `timeout`, the response status code is `500`.

With Kibana in mind, a `4xx` response would be more suitable as it will lead to showing more useful information to the user about why the request failed.

Looking at [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-408-request-timeout), it seems the most appropriate `4xx` code would be `408 Request Timeout`, even though the RFC describes a different situation. 

The alternative, `504 Gateway Timeout`, would be more appropriate for this situation but it wouldn't improve the user experience in Kibana.
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStartDataFrameAnalyticsAction.java
if (requiredFields.isEmpty() == false) {
                msgBuilder.append(" (excluding fields ").append(requiredFields).append(")");
            }
            listener.onFailure(ExceptionsHelper.badRequestException(msgBuilder.toString()));
        } else {
            listener.onResponse(null);
        }
    }
    private void validateSourceIndexRowsCount(StartContext startContext, ActionListener<StartContext> listener) {
        DataFrameDataExtractorFactory extractorFactory = DataFrameDataExtractorFactory.createForSourceIndices(
            client,
            "validate_source_index_has_rows-" + startContext.config.getId(),
            startContext.config,
            startContext.extractedFields
        );
        extractorFactory.newExtractor(false).collectDataSummaryAsync(ActionListener.wrap(dataSummary -> {
            if (dataSummary.rows == 0) {
                listener.onFailure(
                    ExceptionsHelper.badRequestException(
                        "Unable to start {} as no documents in the source indices [{}] contained all the fields "
                            + "selected for analysis. If you are relying on automatic field selection then there are "
                            + "currently mapped fields that do not exist in any indexed documents, and you will have "
                            + "to switch to explicit field selection and include only fields that exist in indexed "
                            + "documents.",
                        startContext.config.getId(),
                        Strings.arrayToCommaDelimitedString(startContext.config.getSource().getIndex())
                    )
                );
            } else if (Math.floor(startContext.config.getAnalysis().getTrainingPercent() * dataSummary.rows) >= Math.pow(2, 32)) {
                listener.onFailure(