Yes - believe it or not, closing credit cards (whether zero balance or not) can negatively impact your credit score.
To explain why, let's start with a look at the components of a credit score. Here's the typical breakout from the folks at FICO:
35% Payment history
30% Amount owed
15% Length of credit history
10% Types of credit used
10% Credit applications and inquiries
Closing accounts will have a potentially negative impact on two of these categories; amount owed (as a percentage of credit available), and length of credit history.
"Amount owed" could be negatively affected because your usage ratio could increase (amount of credit used, compared to amount of credit available). For example, let's say you currently have $10,000 of available credit divided equally between 2 cards. On one card let's assume you owe nothing, and on the other let's assume you are maxed out. Given this scenario, you would currently be using 50% of your available credit. But, if you close the zero balance account, you would then be using 100% of your available credit. Obviously, this would have a negative impact on your score.
Now let's look at "length of credit history." This could be negatively impacted as well, because your average account age could drop if the cards you cancel are among your older relationships. The bottom line here is that you need to be very careful when closing accounts.
In addition to this information, I encourage you to check out these two additional resources on credit scores:
These should be helpful in giving you a better understanding of how the whole credit scoring system works. Thanks again for your question. I hope this is helpful and I wish you all the best!