Custom Query returns array, but I can’t see it’s elements

I can’t comment due to low reputation so sorry for posting this as an answer, but you are missing $ (dollar sign) near groupcat[0]