Consider:
$ read -r a <<<$(echo "foo"; exit 1)
$ echo $?
0
this returns 0, when I really expect a 1. How can I extract the real exit code from the subshell?
You'll need multiple steps:
output=$(echo "foo"; exit 1)
status=$?
read -r a <<<"$output" # assuming the "real" code here is more complex