Well, I think you - after assigning variables to and fro - echo "$CMD", read that , ignore it, and skip the while loop as there's nothing more to read, leaving all variables = 0:
.
.
.
CMD="df -lP"
fi # from somewhere above
OUTPUT=`$CMD` # assign literal $CMD to OUTPUT
echo "$OUTPUT" | # echo $CMD literally - one word in one single line
read IGNORED # ignore literal $CMD, input stream ends, skip loop
.
.
.
I have to revise my comment: I've taken the backtics for single quotes due to sloppy reading - sorry for that.
So, OUTPUT will contain the desired info from df -lP line by line, which you can and do read into several variables to compute with - in a subshell! You can't have subshell variables returned to the calling script except by echoing them there and reading them here.
If I read your script correctly (now, finally!), all you want is the overall available size in MB. Why don't you try to get that in an one-liner:
df -lP | awk 'NR>1 {sum+=$4/1024} END {print sum}'
30569.2