I had a similar problem with PHP where I wanted to run different MAMP versions.
As you have found, the path used by Alfred is not affected by your profile.
I ended up copying the built in /usr/bin/php to /usr/bin/php.osx and creating a symlink from /usr/bin/php to whatever PHP version I wanted to run.
It was tedious to change the symlink to a different PHP version so I created a workflow to make things easier (PHP Version).
An alternative may be to use the full path to the version you want to run.
I'd be interested to learn of a more simple way of doing this.