It looks like the image specified in the docker-compose.yml file, nextcloud:25, might be pulling the wrong version of the nextcloud image from a registry (e.g. Docker Hub).
You can pull the Nextcloud image directly using the docker pull command and check its version by running the command docker pull nextcloud:25 to download the image with version 25.