It’s possible. That’s why you have to redirect these thoughts as hard as it might be to an everythings okay mindset, even if it’s not. It’s the opposite of what you’re talking about. You have to break the cycle in your head, and yes, it is vicious. But what good is dwelling on these things? It does absolutely no good whatsoever for your well being.
I can say one thing though, your mind doesn’t cause your dick to shrink to nothing. If you start getting better, you’ll start to feel better too. You won’t think so many negative thoughts and you’ll want to use your dick. This type of thinking is par for the course with these problems. Knowing that is half your mental battle.