I was the moderator that added that comment, and I'll try to explain my comment here. There is a limit to the number of characters I can add to a flag comment, so may not have been able to include a full explanation at the time.
but I always thought that a post notice was the best choice
and in the flag comment I wrote:
Please don't leave it just to moderators to do this. It should be a community effort
It is a good choice, but not the only choice. In that flagged answer there was no downvote and no additional comment, so the response is left only to the moderator. We encourage community to help improve answers by down-voting and commenting which, if the answerer pays attention to the down-votes and comments, may eliminate the need for a moderator to get involved.
...because, since these answers are generally posted by new or inexperienced users, it would be more impressive than a comment by a user
I don't see myself or the other moderators being any more or less "impressive" than the other volunteers here. We all have something to offer. On the flip-side of your comment, there are a number of users that feel censored by moderators wielding power, so a kind comment by another (non-mod) user has the potential to be more useful than a moderator with a big stick.
I flagged many other answers using the same formula and this is the
first time I received a comment like the one described above. So, my
question is: is it wrong proceeding in this way?
No I don't believe it is wrong, which is why your flag was marked Helpful
helpful - Yes you are right...
However, the point I was trying to make in the flag comment is that I don't believe it is, nor should it be, the only option taken by users.
Remember that moderators are volunteers too, and sometimes there can be many flags that need to be dealt with by the moderator (spam, abuse, arguments, etc.) and we appreciate the help by users to step in and help when and where they are able.
From your comment:
Is it preferable downvoting/commenting and then flagging the answer, or downvoting/commenting only?
There isn't, and can't be, any hard-and-fast rule here. Some posts (or rather, users) may only need a comment, some a down-vote, some a flag as well. I'm not entirely sure whether a user gets a notification if a post notice is added to their answer, so a comment at least may be required to tell the user there is something on their answer that needs looking at. Remember the "flag" options says
flag this post for serious problems or moderator attention
so if you think it's a serious problem and/or needs moderator attention, then flag it. If the moderator disagrees you might get a Declined status on your flag, but I don't think we decline flags too often.
The accepted answer to When to flag an answer as “not an answer”? on Meta SO gives a good guide as to when to flag and when not, if you are unsure. However, based on that answer (and sheer volume of posts and flags there) you'd possibly have found your flag to have been declined on Stack Overflow rather than Helpful.
Keep up the good work, I have noticed the flags and comments you have made and do appreciate the effort.