I get the impression that the error is in the password.
The password uses a . and a ! so as example (i masked it) it looks like 8P!S3D.6DF in the wp-config.php file.
Now when I use this line:
mysqldump -uuser_wp979 -p8P!S3D.6DF user_wp979 >/home/user/backups/dump.sql
the result is:
-bash: 8P!S3D.6DF: event not found
So the only way to do this via commandline (which mysql upgrade also uses) is using the -p without the password and then fill in the password after pressing enter.
mysqldump -uuser_wp979 -p user_wp979 >/home/user/backups/dump.sql
then fill in password after pressing enter and then this error occurs.
Code:
Enter password:
mysqldump: Error 2013: Lost connection to server during query when dumping table `wp_wfconfig` at row: 226
however some dump is made anyway. I didn't test if it would be the same when I would pack it with .tar.zst like DA does.
So it seems as if the password is causing the issue, it shouldn't give that "event not found error" either so that might also be causing the issue with the mysqldump that the mysql upgrade uses. While DA probably uses a different method to provide the password, which makes things work correctly.
Maybe this sheds some more light on the issue? Unless when using DA the Wordfence doesn't care and so WF is the issue.