It's an attempt to answer the question, and that makes the "not an answer" flag improper. It so happens that it's not a correct answer to the question, but that doesn't make it not an answer. In this particular case the reason the answer is incorrect seems to be that the answerer misunderstood the question. As a rule, whenever you think that the poster mis-understood the answer don't flag as NAA. You can either downvote, comment explaining the probelms, and/or post another competing answer that shows what you feel is a solution to the correct interpretation of the problem.
The NAA flag is for times where even the poster themselves doesn't think they're answering the question, such as saying things like, "I also have this problem." or "Why did you choose to Foo the Bar?" (which should just be a comment). It should also be clear to someone with no technical knowledge of the subject material to be able to see that it's not an answer. If it seems like it might be an answer (even if it's wrong) then you should be downvoting and optionally commenting, not flagging.