Live in the now. Don't brood over your past, don't worry about your future, unnecessarily. You accept it and keep doing what you would normally do. Don't try to find meaning or ascribe some meaning to what is otherwise a natural process of our modern life. You have health issues, you get it treated it and try to live healthier. That's it (what more can you do?). You got a new job. Congratulations. Give it all you got as you would normally do. Your company got acquired, you got a new boss, your job sucks now. Skill up. Fight for your current job or search for a new one. (Also, talk to your old boss and close co-workers). Looking back at your past, or worrying about your future is only useful if it helps your present. Live in the now.
If you are going to be in and out, not 100%, etc... you are better off erring on the side of taking medical leave, asking for accommodations as needed, rather than trying to "soldier on" and have any unavailability used against you or characterized as a performance issue.
Aside from that, treat your new boss as a new job / new company that you need to prove yourself too. Your new boss didn't choose you, and may have a desire to "make changes", bring his own people in... etc.
We all (currently) enter and exit this world in the same manor. It's the bit in between that matters. We all could be hit by a car tomorrow or live to be 120. Most of us don't get to know. You got an reality check and a potential expiration date. Congrats, you know more then most of us, and yes, can make more accurate plans. But live, because you likely will!
Now, answer me this. Why should you live your life any differently? And if there is something, should you not have been doing that anyway?
It sounds like you owe yourself some kind of passion project.
Good luck with the treatment! There's really no need to worry about things you've already done your best to sort. You've done your best and put yourself in a winning position.
If your confidence in Linux, switch it up. FreeBSD could do no harm, Haiku. Networking is another path to follow. Learn how to create a network, a home lab, install as AI Interface. Buy a VPS and start mucking around.
I'm a Systems Architect so I have to constantly morph in to new areas when they appear. It's a challenge but I have more "know-of knowledge" than proficient but it keeps me employed.
"What if I integrated X with Y" and see if it works are always fun experiments.
Money, job and responsibilities can wait.