Yes, that has happened to me before. :)
But no, it doesn’t discourage me if someone else has already written about it. Just because one writer writes about a certain feeling or thought does not mean that another writer cannot write about the same feeling or thought.
But of course I then write the poem in a different way from the other writer.
I hope that answered your question! :)