Yes, absolutely! Depression is well known to be one of the acute "calling cards" of thyroid dysfunction. Are you on thyroid hormone medication to stabilize your thyroid function? Obviously, that's imperative; and especially with your heart condition, your thyroid function should be monitored on a very regular basis. Our thyroid also impacts the functioning of our internal organs, and heartrate is a biggie.
And ... having to cope, alone ... without any other stressor(s), with coronary heart failure is more than enough to drive any human being into a depression! However, that (the degree of one's depression) would also depend on the individual's perception ... and the levels of appropriate and healthy coping skills (which was my primary focus study for several years). If you are living in fear &/or anxiety, and can't stay "in this moment," while addressing the medical care and lifestyle needs that pertain to your heart condition, that will certainly prove stressful and can push you into depression. In that case, Yes, absolutely.
After reflecting on your post, it sounds like you have come to terms with the heart condition? Which is why you are suspecting thyroid dysfunction to be the culprit? You would be the only person that can make that determination after a thorough "self" examination once those hormones are proven regulated by your physician. Are you at peace with your circumstances? That would be a good gauge to determine if it's the thyroid dysfunction, or the "acceptance" issues you face with such a serious heart condition; in getting down to the core cause of the depression.
Or ... it could be the wonderful "combo platter" of both, or more factors. I can only suggest that you do start with some soul-searching; and you already should have addressed the other two issues on a tangible basis regarding necessary care & evaluations. If you haven't, please do. As once thyroid hormones are regulated, which can be very tricky, you'll have to look at other things.
If you've been under a lot of emotional/physical stress lately, it may be that you simply are depressed and nothing is to blame; in that case, an anti-depressant medication may be in order ... giving careful consideration to your heart condition and your medical history, of course. You may just need a little help, and there's nothing wrong with that; you've been through a lot, and so has your body. Stress is very hard on the body, and it's very possible that you could be experiencing a chemical imbalance in your brain, given the "flood" of emotions you have been experiencing recently.
My suggestion is to follow up on this with your physicians.
Best of luck to you! Prayers for good health & much hope.
p.s. Anesthesia has also been known to trigger depression. Most times, this depression passes; other times, it remains and needs a little help to dissipate; anesthesia's are very powerful and can really put our body in a "tailspin" for awhile.