The globally installed packages only take precedence over local packages when you run the binary name from the command line. To get that to stop, you'd have to add the local node_modules/.bin to the PATH. Additionally, if you run npx/yarn/pnpx in a package script, it will use the local binary.
> oh that and installing thousands of packages in the project root instead of a sensible place that could be shared per version like bundler and rubygems.
Look into pnpm. It does precisely this in a way that's compatible with node.
Honestly the information is out there to address most people's gripes.