The return value is either 0 or 1.
I don't know enough about coding to know what a variable's scope is. *SearXNG noises* You might be onto something. You think the function is being piped into a subshell?
Brackets didn't seem to help in my script; although maybe I should make a smaller test script just to rule out incompetence. (I'm guessing on the proper syntax for that, something like if ! [[ $(name_of_function "$arguments") ]] ; then, yes?)
I've tried both versions. name_of_array=() in or out of the function, also declare -a -g name_of_array, if I'm remembering those arguments right, at the top of the script.
Thanks for indulging my curiosity; I appreciate it.