One example I've come across for this question is if someone asks "don't you want ice cream?" If I say yes, people typically interpret it as "I want ice cream", but grammatically it would mean that I didn't. If I say no, technically that's saying that I do want ice cream, but people interpret it as that I don't want ice cream. What do native English speakers do: be grammatically correct or be more easily understood?
Despite what some people may think, most speakers would rather be understood than be grammatically correct, since if one is not understood then *what's the point?". Thankfully being grammatically correct has a high correlation to being understood.
That is not to say even though one is being understood one should become lazy and not try to become better and improve.
This particular pattern has been beaten into native speaker's brains enough that they will understand what is being said and what is being meant. After all, all a young child needs is to miss out on one ice cream and they will learn very quickly!
The response is based on
Q: Would you not like some ice cream?
do you want some ice-cream?
A: Yes, I would like some ice cream.
and not as you are thinking
Q: You would not like some ice cream?
A: Yes (I agree with you that) I would not like some ice cream.
"Would you like some ice cream?" is entirely straightforward. "Would you not like some ice cream?" or "Wouldn't you like some ice cream?" or "Don't you want any ice cream?" seem to be appropriate if, for example, other people have been helping themselves to ice cream, but the person addressed has not, possibly out of shyness, and the speaker is encouraging them to take some. I think that there is an implied question "Is there some reason why you would not want ice cream?, because if there is no reason you should feel feel to go ahead."
Because the question is very abbreviated, it would be good to make the answer explicit. "Thank you, yes, actually I would like some." OR "Thank you, no, actually I don't like it very much"