It should be "array(string) can not be cast to string" or "Only array(int) can be cast to string" or something similar.
And the fact that it's the last index and not the first that you get the error about is confusing unless you know how pike works internally.