If your ovary or too much ovarian tissue was removed then it can affect mood as well as other aspects of health since the ovaries produce health promoting hormones (as well as for fertility). These problems may be temporary or permanent. Did the surgeon do a cystectomy (cyst removal) or oophorectomy (ovary removal)?
Contrary to what people believe and maybe even what is taught in medical school, the ovaries are endocrine glands and produce hormones a woman's whole life. The uterus and its supporting structures are also vital to a woman's health in a number of ways besides reproduction (anatomical, skeletal, sexual, hormonal). Hysterectomy and oophorectomy are two of the top overused surgeries. C-section is also grossly overused. It's a travesty that so many women lose their uterus and/or ovaries for benign conditions since removal of any one part or the whole system is proven to be destructive.
I hope the emotional fall-out is only temporary.