Hi and thanks for the query.
Most of the erectile dysfunction cases are due to inorganic conditions like performance anxiety however, it is always best to rule out any organic causes first and if none is found, a sex therapist can be contacted for counselling. I would suggest that you go to your GP for this and have a battery of tests done for Erectile Dysfunction. Weight gain plus loss of erection can be due to testosterone deficiency, so this needs to be evaluated.
Hope this helps.
Let me know if you have any further queries related to this.
Please do not forget to leave a positive rating for the service, by clicking on the stars on top of the screen.