When you hide an item server side, the item that's refreshed/hidden isn't rendered to the browser. That's the reason you get an error.
What I tend to do is to wrap the item that should be hidden with a xp:panel or xp:div. Refresh the wrapper. Then the item is hidden/shown, and the refresh can run.
If the repeat control isn't big, you could skip the wrapper, and just refresh the repeat.