Now here’s the other issue:

You are optimizing to select one of three series calls in an array, but you chose to call all three series in all cases? Even if it did compile, very suboptimal.

So do this:
Declare a vars, no definition, no array.
Then based on the optimize output, use an if-then statement to determine which series call goes to the vars.