Confusing error message on workflow_dispatch trigger

According to documentation: https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event ref parameter is required. When I run the workflow from UI and choose a branch where workflow is not present, it says:

Workflow does not exist or does not have a workflow_dispatch trigger in this branch.

When I trigger it using API, I get a confusing message:

curl --header "Authorization: Bearer $GITHUB_TOKEN" --header "Accept: application/vnd.github.v3+json" -X POST https://api.github.com/repos/USER/REPO/actions/workflows/workflow.yml/dispatches -d '{"ref":"refs/tags/feat_some_new_feature"}'

{
  "message": "Workflow does not have 'workflow_dispatch' trigger",
  "documentation_url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event"
}

It would be more clearer if it says about “specified ref”:

{
  "message": "Workflow does not exist or does not have a workflow_dispatch trigger in the specified ref",
  "documentation_url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event"
}