I've seen a few users with a gold badge in a tag answer a question, and then immediately close the question as duplicate.
Here's an example of a question which it happened on (EDIT: The answer has been removed, and is now only viewable to users with 10k+ reputation. This question is not only about this one post, but about all posts that this happens on).
The problem with this is that it probably cannot be solved. If I was in the same position, I would probably answer the question before closing it, to make sure the user gets a good answer.
There's already been something discussed about this on Closing a question as a duplicate, then answering it, but that had to do with voting to close the question, this was done without any voting, due to the mighty Mjölnirs being able to close/reopen questions without voting.
I personally don't see anything wrong with this, as long as the user isn't doing it for personal gain (it would be fine if they made the answer community wiki). Are there any guidelines on what gold-badge users supposed to do with respect to this?