Why does sql-sync fail? I'm managing Drupal 7 and Drupal 8 sites, so I'm running Drush 8 as that's the only version that can manage both. The Drupal 8 sites are installed using Composer and my local setup runs on MAMP 5.5.1.
It works fine for the Drupal 7 sites, and rsync works for the Drupal 8 sites as well. However, sql-sync fails. When I run drush sql-sync @local.dup @prod.dup, I get the following messages.


  Warning: require(/Users/username/path/to/local/vendor/bin/drush.php): failed to open stream: No such file or directory in /Users/username/path/to/localvendor/bin/drush on line 4
  Fatal error: require(): Failed opening required '/Users/username/path/to/local/vendor/bin/drush.php' (include_path='.:') in /Users/username/path/to/local/vendor/bin/drush on line 4
  The command could not be executed successfully (returned:                                                                                                                                        [error] Warning: require(/Users/username/path/to/local/vendor/bin/drush.php): failed to open stream: No such file or directory in /Users/username/path/to/local/vendor/bin/drush on line 4
  Fatal error: require(): Failed opening required '/Users/username/path/to/local/vendor/bin/drush.php' (include_path='.:') in  /Users/username/path/to/local/vendor/bin/drush on line 4, code: 255)
  The Drush sql-dump command did not report the path to the dump file produced. Try upgrading the version of Drush you are using on the source machine. 


I get similar errors when checking drush @local status and drush @remote status as well as when I try to use the Drush 9 included in each site ( cd path/to/docroot > vendor/bin/drush @self @remote).

I've tried removing all Drush instances and installing only the same version that my host (cloudways) uses on the remote server (Drush 8.0.5) with no luck. I've installed Drush using CGR as instructed on Install (alternatives).
I've also checked my alias' file in the global Drush folder multiple times and can't find any issues.

What can I do from here to debug and resolve the issue?
I ended up running two global drush installs as explained here.

I needed to make to use same versions of Drush 9 both globally and on the site-specific installs to not get any errors. Now both Drush 8 and Drush 9 seem to run smoothly alongside each-other.