Bug in OpenSearch search templates

OS 2.16.0

Hi all, I noticed the following not working as expected, as shown in the below examples. Please let me know if there is something wrong in my scripts and if there is any alternative ways to achieve the same behavior.

GET _render/template
{
  "source": "{\"query\":{\"terms\":{\"play_name\":[\"{{#play_name}}\",\"{{.}}\",\"{{/play_name}}\"]}}}",
  "params": {
    "play_name": [
      "Henry IV",
      "Othello"
    ]
  }
}

It returns additional spaces as shown below which is not what is described in the documentations.

{
  "template_output": {
    "query": {
      "terms": {
        "play_name": [
          "",
          "Henry IV",
          "",
          "Othello",
          ""
        ]
      }
    }
  }
}

I also noticed that setting the default values does not work in this case!

POST _scripts/test_script
{
  "script": {
    "lang": "mustache",
    "source": "{\"query\":{\"terms\":{\"play_name\":[\"{{#play_name}}\",\"{{.}}\",\"{{/play_name}}\"]}}}",
    "params": {
      "play_name": [
        "Henry IV",
        "Othello"
      ]
    }
  }
  
}
GET _render/template
{
  "id":"test_script"
}

The return is shown below with empty play_name which means the default values did not work.

{
  "template_output": {
    "query": {
      "terms": {
        "play_name": [
          ""
        ]
      }
    }
  }
}