How to remove filter alias from backing index of a data stream?

Hi, I have an alias in my index template for test data stream to let me query for data in the last few days like the following:

{
  "recent": {
    "filter": {
      "range": {
        "@timestamp": {
          "gte": "now-3d/d"
        }
      }
    }
  }
}

It seems to work correctly but I cannot remove the index from the alias afterwards using:

POST _aliases
{
  "actions": [
    {
      "remove": {
        "index": ".ds-test-2025.05.11-000001",
        "alias": "recent"
      }
    }
  ]
}

with the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "The provided expressions [.ds-test-2025.05.11-000001] match a backing index belonging to data stream [test]. Data stream backing indices don't support aliases."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "The provided expressions [.ds-test-2025.05.11-000001] match a backing index belonging to data stream [test]. Data stream backing indices don't support aliases."
  },
  "status": 400
}

I can use the recent alias for search:

GET recent/_search
{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": ".ds-test-2025.05.11-000001",
        "_id": "Yl2wvZYBm63werLaQdbq",
        "_score": 1,
        "_source": {
          "text": "Hello, World!",
          "@timestamp": "2025-05-11T00:00:00Z"
        }
      }
    ]
  }
}

so the backing index clearly supports alias but the error says to the contrary. The reason I want to do this is to remove old shards from being queried unnecessarily (e.g. thousands of shards) as the recent alias will be queried dozens of times per second. This is using Elasticsearch 8.18. What am I doing wrong? Thanks!

The backing index has the alias because it was added during the creation by the index template, but as far as I know you cannot add or remove alias to backing indices.

I don't think this is necessary, Elasticsearch already has some improvements and know where the data is to query only the shards that have the data, some of these improvements are explained here.

I see. Out of curiousity, is there a technical reason why it can't be removed or is it just not implemented?

No Idea, I don't think the reason for this is documented anywhere.