There is no compose file version anymore. Docker Compose v2 ignores it and the supported syntax depends on the version of Docker Compose itself.
Because that is container_name
and it was always that.
PS: Please follow our guide to format your post next time: How to format your forum posts