Changing project name in compose file causes issues with traefik

I seem to have stumbled up an issue, where traefik cannot find any services if the project name was set manually using docker compose.
So for example, if my docker compose file is like this:

version: '3.8'
name: 'reverseproxy'


If I remove the name, then everything is back up online. The dashboard does not show any issues when I change the name, it shows all services to be online. Trying to access the url gives me a bad gateway. In the logs, the error is:

time="2023-07-30T16:18:38Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp: lookup grafana on no such host"

My dynamic conf is configured like this:

          - url: "http://grafana:3000"

Just curious why changing the stack name in compose make everything fail. Am I missing something? Thanks in advance!

Share your full Traefik static and dynamic config, and full docker-compose.yml.