Custom shell script can't be found
I would sym link the scripts you place out of the path to /usr/local/bin so you don't need to reason with ~ expansion in .dot files for your shell.

It's possible to have a durable way to ensure your enviroment is set up to handle ~ - but I'm a fan of having absolute paths there to avoid problems when you su to other users and have environment cross contamination as well as issues like you face.

This isn't anything about homebrew - purely about bash or whatever shell you are using.