Cannot generate dynamic child pipeline if child's YAML use `only` or `rules`

Hey folks,

We are trying out dynamic child pipelines and generate everything works well, until we decided to add 'only: changes' and 'rules: changes' in our child pipeline YAML.

Here is a sample job in the child-pipeline.yaml

testing_anchor5:
  after_script:
  - echo Hello World
  - echo Bye World
  before_script:
  - echo 1
  - echo 2
  rules:
  - changes:
    - .gitlab-ci.yml
  script:
  - sleep 10
  - echo "I do nothing"
  stage: test
  tags:
  - docker

Similar issue is being reported in https://forum.gitlab.com/t/downstream-pipeline-cannot-be-started/36860

Child pipeline will work if we remove the rules: or only: keys from the generated yaml for child-pipeline.

Is this intentional?