Help with Erectile Dysfunction

Hi, I am at my wits end with ED and it is now causing serious relationship issues with my partner of 3 years. Here are the facts if someone can offer some help that would be appreciated - I am 36 years old, I was in a long term relationship to be married to a girl but then we split up and I then met my current partner who is a man. He was already out as gay and we went through the first 12 months with me having not come out, which caused some strain on our relationship. The sex was however always good with no issue. Wind the clock 24 months, I am now out as gay, we are engaged to be married, I love him more than words, though ED started for me 6 months ago. Pre-covid I was very active and played sport 4 times a week, now my only excercise is walking the dog. Health reasons have forced me to give up my sporting days. So the ED happens, both non erection and then part way through sex. I do think about the last time it happened and then try to not repeat the same scenario, but rather than maybe once or twice a month it is now like 3 times a week. My partner thinks it is him and that I am no longer attracted to him, it is really getting him down to the point that he doesnt see a future together. I try and reassure him thats not the case, I have pills as prescribed by the GP after saying what my issue is, but the issue just doesnt go away. It stresses me out no end as I want to pleasure him but I just can't, yet I could have an erection in the morning or on the sofa sat next to him but not when it comes to sex. What is wrong with me please?