Well, if you edged for 3 years, and only recently stopped doing it, it may take some time for your body to stop expecting that.
You've been to the doctor, so what did he think is the cause of your ED? Did he rule out all physical issues? Did he check your heart, etc?
Are you still smoking weed? That might be affecting it, too. Do you drink alcohol? That can definitely affect it.
I'd also be surprised if some anxiety isn't at play here - now you're worried about it every time you try to get an erection, which makes you stress, which makes the whole thing trickier, which causes a vicious cycle of "will I get an erection and what will happen and oh look it's still not totally hard why is this happening".
Work on the smoking (and as a former smoker, I can tell you that you'll feel so much better when you quit, and that's the end of the preaching), stop the porn at least for now, and let your body get used to a new norm for a bit.
If your doc has ruled out any physical causes, then it may just need some time.