The issue is that your ~/.bashrc file is being sourced before the echo test command runs when the SSH session starts. This happens because, by default, SSH sessions that execute a command (via command="..." in authorized_keys) still initialize a login shell, which sources ~/.bashrc.
Solutions
1. Use bash -c with --noprofile and --norc
Modify the command in your ~/.ssh/authorized_keys to explicitly skip sourcing ~/.bashrc and ~/.bash_profile: