Writing and Depression

I have been told, just like many people have, that keeping a journal can help with depression. Sometimes too, people mistake someone’s dark-themed poetry or writing as a warning sign in someone who is perfectly fine.

An example of journaling being helpful is the short story The Yellow Wallpaper by Charlotte Perkins Gilman–the husband not allowing his wife to journal because he thought it makes her depression and insanity worse actually allows it to worsen because her suffering has no outlet.
An example of writing not necessarily working could be Virginia Woolf–finishing a novel caused espisodes of depression that got worse and lasted longer with every novel she completed.

Why does something recommended for therapy sometimes make the problem worse? How does such a thing happen? I become depressed from writing as well, but not always.
I’d like to know what your thoughts are on this. Do you know anyone who has a reaction like this? Does writing actually help or make it worse? What are your experiences with such a thing?