I had the same issue.
Machine running Nextcloud 20.0.8 on MySQL 5.7.33 and the admin overview page showing
MySQL version “5.7.33-0ubuntu0.16.04.1” is used. Nextcloud 21 will no longer support this version and requires MySQL 8 or higher.
So I was very careful before proceeding. I was shown that an “Upgrade to 20.0.9” was available and I assumed that launching the upgrade would upgrade to 20.0.9.
But it upgraded to 21.0.1 instead and broke the installation.
I upgraded MySQL to v8, but the NC21.0.1 installation was still broken.
I restored my backup of 20.0.8 on the machine now running MySQL 8.
It restored fine.
Then I ran the upgrade again, which again seemed to indicate it would upgrade to 20.0.9 but did upgrade to 21.0.1.
This time, the upgrade went fine and the 21.0.1 installation came out functional, except for a small problem with running the occ utility, which was fixed as shown in Running php gets killed - #4 by wizkid