Your cron entry is wrong. First try on the command line if it works, then put it in cron.
I never used sudo in cron commands, but depending on your configuration that might not work. If you need root rights, then put it in the root crontab.
Your command executes it in container “nextcloud”. If you have a second container, it will have a different name which you should use.
See also: Nextcloud Docker Container - best way to run cron job - #4 by sanctimon
docker exec -it CONTAINERNAME crontab -e -u www-data
should open your crontab, then put there */5 * * * * php -f /var/www/html/cron.php
Or do it like here: Docker setup & cron - #7 by lazmol