As @grautur pointed out, "lately" is not used to describe a single recent event, when the sentence is affirming an action, so your first example sentence is an incorrect usage. One reason why its meaning is restricted may be that it is, as a word, less common.
To expound:
"Recently" can refer to any event or events in the near past.
"Lately" can refer to any recurring event in the near past, or to a single event when one is saying that it did not happen in the near past.
For example, the following example is incorrect, because it is saying that the event did happen in the near past:
I went to the library lately.
"Recently" is the only word to use here. However, if you did not go to the library, and want to say so, you have a choice between "lately" and "recently" (also remembering that haven't gone instead of didn't go flows better here):
I haven't gone to the library recently.
I haven't gone to the library lately.