I believe that error has been seen before in upgrade scripts. Please see here and here for reference.
Previously the solution has been to issue the SQL statements manually and check the results.
I am sorry for your trouble. In my opinion the developers should test the scripts with MySQL 8 too.