### Apache Airflow version

2.3.4

### What happened

https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/get_task_instances_batch
fails with an error with wildcards while
https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/get_task_instances 
succeeds with wildcards

Error:
```
400
"None is not of type 'object'"
```


### What you think should happen instead

_No response_

### How to reproduce

1) `astro dev init`
2) `astro dev start`
3) `test1.py` and `python test1.py`
```
import requests
host = "http://localhost:8080/api/v1"
kwargs = {
    'auth': ('admin', 'admin'),
    'headers': {'content-type': 'application/json'}
}
r = requests.post(f'{host}/dags/~/dagRuns/~/taskInstances/list', **kwargs, timeout=10)
print(r.url, r.text)
```

output
```
http://localhost:8080/api/v1/dags/~/dagRuns/~/taskInstances/list 
{
  "detail": "None is not of type 'object'",
  "status": 400,
  "title": "Bad Request",
  "type": "http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/stable-rest-api-ref.html#section/Errors/BadRequest"
}
```

3) `test2.py` and `python test2.py`
```
import requests
host = "http://localhost:8080/api/v1"
kwargs = {
    'auth': ('admin', 'admin'),
    'headers': {'content-type': 'application/json'}
}
r = requests.get(f'{host}/dags/~/dagRuns/~/taskInstances', **kwargs, timeout=10)  # change here
print(r.url, r.text)
```
```
<correct output>
```

### Operating System

Debian

### Versions of Apache Airflow Providers

_No response_

### Deployment

Astronomer

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

"""Initialize Internal API"""
    if not standalone_api and not conf.getboolean("webserver", "run_internal_api", fallback=False):
        return
    with open(path.join(ROOT_APP_DIR, "api_internal", "openapi", "internal_api_v1.yaml")) as f:
        specification = safe_load(f)
    api_bp = FlaskApi(
        specification=specification,
        base_path="/internal_api/v1",
        options={"swagger_ui": conf.getboolean("webserver", "enable_swagger_ui", fallback=True)},
        strict_validation=True,
        validate_responses=True,
    ).blueprint
    api_bp.after_request(set_cors_headers_on_response)
    app.register_blueprint(api_bp)
    app.after_request_funcs.setdefault(api_bp.name, []).append(set_cors_headers_on_response)
    app.extensions["csrf"].exempt(api_bp)
def init_api_experimental(app):
    """Initialize Experimental API"""
    if not conf.getboolean("api", "enable_experimental_api", fallback=False):
        return
    from airflow.www.api.experimental import endpoints
    warnings.warn(
        "The experimental REST API is deprecated. Please migrate to the stable REST API. "
        "Please note that the experimental API do not have access control. "
        "The authenticated user has full access.",
        RemovedInAirflow3Warning,
    )
    app.register_blueprint(endpoints.api_experimental, url_prefix="/api/experimental")
    app.extensions["csrf"].exempt(endpoints.api_experimental)