"The LHS of s/// is a regular expression, but the RHS is not. So, you can not expect them to behave the same way."
Nevertheless, RHS accepts the \xNN format if it is hardcoded in the script. It is only when it is passed from the terminal that it doesn't work. Why not? What makes it different when it is passed from the terminal?