Jessi, that's a good thing to point out.
Unfortunately, if the o.p. doesn't know if he ever had Covid, he isn't going to be able to test now to see if he had an undiagnosed case sometime in the past. But if he does know that he did once have Covid, definitely he should bring this up with the doc when discussing ED.
(That said, my thought is if he had Covid already, he wouldn't be asking whether the shot gave him ED, he'd just ask if Covid gave him ED. A person who has had Covid would always wonder if anything after it, came as a result of having it.) But it's well worth posting this info both for him and for anyone else who does know they have had Covid and then finds themself with this problem.
No, but covid itself could. Did you ever have it?
https://www.nebraskamed.com/COVID/fact-check-erectile-dysfunction-swollen-testicles-and-sperm-count-after-covid-19-vaccination-or
https://www.webmd.com/lung/news/20210513/coronavirus-lingers-in-penis-and-could-cause-impotence#1
https://health.clevelandclinic.org/yes-covid-19-can-cause-erectile-dysfunction/
https://www.webmd.com/lung/news/20210407/erectile-dysfunction-risk-6-times-higher-in-men-with-covid
You should always see your doctor to rule out any physical causes of ED, and then you can focus on the psychological, if that's what is causing it.