Molecule error started happening for role dependency

I have a repo of an ansible role tested with molecule for some years now. Without a real change, my tests started failing on August 2023 when I import my role due to its dependencies on meta/main.yml.

For some reason I get the error:

  TASK [Include staticdev.python_developer] **************************************
  ERROR! the role 'staticdev.pyenv' was not found in ansible.legacy:/home/runner/work/ansible-role-python-developer/ansible-role-python-developer/staticdev.python_developer/molecule/default/roles:/home/runner/.cache/molecule/staticdev.python_developer/default/roles:/home/runner/work/ansible-role-python-developer/ansible-role-python-developer:/home/runner/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/runner/work/ansible-role-python-developer/ansible-role-python-developer:/home/runner/work/ansible-role-python-developer/ansible-role-python-developer/staticdev.python_developer/molecule/default
  
  The error appears to be in '/home/runner/work/ansible-role-python-developer/ansible-role-python-developer/staticdev.python_developer/meta/main.yml': line 37, column 5, but may
  be elsewhere in the file depending on the exact syntax problem.
  
  The offending line appears to be:
  
  dependencies:
    - name: staticdev.pyenv
      ^ here

The role exists on Ansible Galaxy with correct version. This error only happens on Github Actions, but not locally. I do not really understand why, but on my path locally molecule can find staticdev.pyenv and can import statically. Do I need to add anything extra to install the requirements?

I tried found a change in the docs for syntax of role-file to requirements-file, but both syntaxes give the same failure:

dependency:
  name: galaxy
  options:
    requirements-file: requirements.yml

Does anyone has an idea?

A. requirements.yml

---
roles:
  - src: https://galaxy.ansible.com/staticdev/pyenv
    name: staticdev.pyenv
    version: "2.0.0"  # Replace with the desired version

B. molecule/default/molecule.yml

---
dependency:
  name: galaxy
  options:
    role-file: ../../requirements.yml  # Adjust the relative path based on your project structure
    ignore-errors: false
driver:
  name: docker
platforms:
  - name: instance
    image: geerlingguy/docker-ubuntu1804-ansible:latest  # Use an appropriate base image
    pre_build_image: false
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
provisioner:
  name: ansible
  lint:
    name: ansible-lint
scenario:
  name: default
verifier:
  name: ansible

C. .github/workflows/molecule.yml

name: Molecule Tests

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.8'  # Specify the Python version compatible with your project

      - name: Install Ansible
        run: |
          python -m pip install --upgrade pip
          pip install ansible

      - name: Install Molecule and Docker
        run: |
          pip install molecule[docker] docker

      - name: Install Role Dependencies
        run: |
          ansible-galaxy install -r requirements.yml

      - name: Run Molecule Tests
        run: |
          molecule test

D. meta/main.yml

---
galaxy_info:
  author: Your Name
  description: Your role description
  company: Your Company
  license: license (e.g., MIT)

dependencies:
  - role: staticdev.pyenv
    version: "2.0.0"  # Ensure this matches the version in requirements.yml