I come to answer a question and when I send my answer I see that the question is closed 4 minutes ago. I think that this is possible because I was writing in the moment at a user has marked the question as duplicate. But I think that if a question is closed, I shouldn't post a answer.
1 Answer
Well, you have answered the question correctly (within the given posting grace period), and it's been accepted it seems.
Though there is a duplicate, that was answering the question earlier (or even later and better), and a user (with the appropriate powers) marked it as such.
That doesn't make your answer bad, or less useful for future research. You shouldn't worry about such situation.