Use specific array column in the where clause
You put the cast outside the array constructor - use ::varchar[] instead.  The current query will return you the array literal (which is of type varchar) instead of an actual array - see the example SQL Fiddle.

But overall, if you only need the output as an array downstream, it would make your life easier if you returned proper columns upstream - easier to use those in a WHERE clause, for example.  Then construct your array directly before returning it to whatever that needs it.