When you run
test="-efoo"; echo ${test:0:2}
echo is run with the argument -e, which in some echo implementations including the echo builtin command of most bash deployments, is a valid option and is thus “swallowed”.
test="-efoo"; printf %s\\n $"${test:0:2}"