You don't say how much weight you have gained, your age, sex, habits, occupation, family history, etc.
In any case, I can see no reason why "Since my surgery, I have gained so much weight.." in that there is nothing with heart valve repair that should lead to such an undesirable result. I am assuming that your thyroid medication is in the desirable range.
You may well need help losing weight - but that should be your goal without unnecessary excuses.
Please be aware that I am unable to diagnose medical conditions online.