Restoring a mysqldump loses user privileges for routines?
You need to add the --set-gtid-purged=OFF flag to your mysqldump statement. This will stop it from writing the set-gtid-purged line in the dump file.