This has nothing to do with your case statement. The problem is that you're referencing a column that is not in an aggregate function (SUM, for example) and you are using a GROUP BY clause and it isn't part of that either. Because it is not in either of these it cannot be used in your select statement.
You didn't post the entire query so we'd only be guessing at specifically where in your query things are going wrong. Again, not really related to the use of case statements at all here.