TLDR: Your comment wasn't needed to improve or clarify the post it was written under, so a mod responding to a no longer needed flag would have reason to honor the flag and delete the comment.
I'm not familiar with the technologies involved in the questions... but if the question is not a duplicate (answer to B does not apply to A), and someone flagged that comment as "no longer needed", they wouldn't be wrong.
That comment didn't bring anything needed for question A: it didn't ask for more information or suggested improvements to the question.
The comment didn't even address the question asker, but future readers, and didn't actually refer to the specific post it was written under, but to the subject in general. Information for future readers should be incorporated into the actual posts (either a question or an answer).
It's not a rude comment, it is not an abusive comment, it is not unfriendly or unkind but it doesn't serve any additional purpose for that question. The main purpose of comments is to help improve or clarify a post.
Your answer in the other question might be tangentially relevant (I'm taking your word for it being relevant and not a dupe), but so would be answers to possibly dozens of other questions. We do not need comments advertising their existance for each of those.
In that sense, a no longer needed flag could have easily had been acted upon by a moderator.
Related
section is usually useless in the first place.