It did rarely happen with my works, but I saw it often about other's people works.
There are many reasons and many kind of intents behind someone's claim that a work is similar to another one. It's not necessarily insulting (but it may be) and it's not necessarily stupid even if it's not very clear. Some people will naturally make links between things I would not necessarily think of, and to me it's a source of new knowledge and a great way to start conversation.
So, I don't get pissed off by this kind of remarks, I first try to understand where they come from.
What's really annoying me is when it's coming from crass ignorance and there is subsequently a complete reject of any learning.
One common case is with historical or mythological characters that some people think are OWNED by whatever hyperpopular company which wrote a story about them, and these people will assume that you took reference from that newer work. That's fine at a first approach (not everyone can know the history of all regions and eras), but too often, the person will not listen or accept that the story/character existed before the recent pop culture reference, or will be adamant that you cannot possibly know about the earlier references.
I think the most puzzling thing, that makes these cases very frustrating to me, is that I cannot understand how people can be so insecure about their lack of general knowledge that they feel the need to deny the knowledge of others, if they refuse knowledge anyway and are actively trying to stay ignorant. How is it logical? It just drives me crazy.