I'm going against all the general advice here but will just give my opinion based on experience.
Unfortunately, I have very close friends who suffer from MH issues. One was fully healthy for 40 years, had a big stress in life/situation and got a depressive episode. He completely changed while going through it, completely withdrawn, as if he had no feelings. He made almost a full recovery with medicines and therapy with a Psychiatrist. Now he's mostly OK but still can't handle stress as most people would.
I have another friend who had everything going for her, was even having her wedding, had some issues with relatives and that was enough to push her into depression and not feeling happy about the wedding. Another friend got depression due to IVF failures, ended with no child, broken marriage (due to infertility), then got a chronic illness.
You mentioned that he has a chronic pain, even surgery didn't help. The pain along with the infertility/IVF, not consistent job, would be enough to push some people into depression.
Obviously is not acceptable how he's treating you, but it's hard to know if it's the illness talking. I would go with him to the appointments, encourage him to get treatment and see a phsycologist as well. Sometimes medicines are not enough and they need to learn to control their thoughts through CBT. He can take months to get better, there's no magic pill. It is really important that he does want to get better.
You could give yourself a timeline, try to support his MH treatment for a few months and if you see no improvement then move on.