Meds for depression are not a panacea. You still have to make an effort to improve, and they have side effects. There is a difference between libido and potency. Libido is the interest to do it. Potency is the capacity to do it - mostly ability to obtain an erection in males.
Most antidepressants improve libido because depression tends to decrease it.
So, as you are lifting from the depression, one of the symptoms that gets better is the lack of interest in sex. Libido e mobile qual piuma al vento - or better yet, in the storm. Some antidepressants interfere with the potency or the act itself. Tricyclic antidepresants have a tendency to worsen neuropathy so, in males, they may cause or aggravate or trigger impotence. These people may have their libido come back, but they find out that there is no erection.