That's an unfortunate cycle! When you ask what it is due to, perhaps just your anxiety and that triggers it for you. Have you ever seen a therapist? This might be a really good route for you to take to explore what might be underneath it all. Are you in a relationship with a regular partner?
I'd want to caution that if you've never been actually tested for heart irregularities they may not exist. You may feel they do, but in most cases those of us with anxiety go to the ER and keep being told there's no heart problem. Now, anxiety sufferers get as many heart problems as anyone else, but we tend to assume heart problems because of how anxiety attacks make us feel. Something that happens after orgasm especially in men is relaxation but also an expenditure of testosterone. It can make us tired briefly. Women, on the other hand, are often energized by orgasms. People are different. You might be feeling this, therefore, as a letdown that feeds into the anxiety and perhaps depression you feel. There's also the problem of guilt -- some people feel guilty about masturbation, and some by sex. Don't know if that includes you or not. Could be something physiological as well. Most anxiety sufferers feel better with exercise, but others don't react well to increased intensity of breathing that comes with it. My sister suffered from that. Lots of things it could be. But if you've had anxiety for ten years, what are you doing to treat it?
I'm doing therapy with Sertaline 0,25 mg for day and I go to a Psycanalist since two years. I dont know... often i have low libido and weak erections (with or without SSRI) , but when I start SSRI or i high dose i feel very aroused for two three weeks with many erections during the day. I dont' have a partner now, and I avoid sex because of my sexual problem.