In your case, it was wasted effort to give honest feedback but that one case isn't enough evidence to say "never".
There isn't a right and wrong answer here. Sometimes it's best to give honest feedback, sometimes it's best to lie or avoid the question. It all depends on the person asking for feedback and the company's culture. It's never a good idea to burn bridges and if giving honest feedback cannot happen without burning a bridge, avoid it.
Additionally, there are probably opportunities to reshape your criticisms in such a manner to not offend. Some people are naturally good at this and others are naturally terrible at it. If you're not good at it, it's a fantastic skill to work on.