When using Composer version 2.2. If you run certain Composer commands like installing a module. The symlinks inside /vendor/bin/ will be replaced with regular files which then breaks Drush. I was using Composer version 2.1.5 without problems. The problem started after upgrading to version 2.2.7
Steps to reproduce. If not using the latest Composer, upgrade it by running composer self-update 2.2.7 Make sure you have symlinks inside your drupal project folder /vendor/bin/ Install any module by running composer require ‘drupal/rabbit_hole:^1.0@beta’ Check the folder /vendor/bin/ The symlinks were replaced by regular files. deleting the bin folder and running composer install will not recreate the symlinks.