Seems like the point 6 from "History, SCP and SFTP" here. In shell startup scripts on the target server try to find a line similar to
PATH='$PATH:/opt/python/3.9.2/bin:$HOME/.local/bin'
. Is there such a line? Single-quotes make no sense here, use double-quotes instead. (To view or edit startup scripts you may need to use full paths to executables.) Does this help?