I hate to say this, but your long-term health is more important than your ideation of a career path in software and its not impossible your best choice is to seek a job that leverages your skills but isn't focussed on FAANG or start up culture. One with an agency or company which has a good HMO and a good work culture.
This does appear to be a solid description of software culture, especially of the Bay Area: avoid looking bad. That describes an unintentional form of conformity, perhaps Machiavellianism. Contrast that with a near opposite subculture like military, especially of the east coast, often expressed in terms of stubborn hyper ethical deviation.
In one case the goal is either to please or save face as determined by a person’s level of agreeability but in the other case the people, especially the self, are just nameless tools to accomplish a goal such that agreeability only determines level of care.
When you learn how to recognize this in the intentions of other people you are in a much better position to manipulate the conditions to accomplish what you believe to be important.
By necessity, large companies ultimately operate by documented process and this makes it hard for them to accomodate outside-normal needs unless such accomodation has been encoded in the process.
Meanwhile, small companies are still just collectives of people trying to make something happen. If you do good work and demonstrate responsibility and long-term commitment, you can usually earn plenty of affordance for whatever noise your health issues bring to individual days.
But there are really two options -
1) You can do the job, with reasonable accommodations. So talk to a doctor to see what can be done to help you. Have them write a note of what accommodations you need, and give it to your company's HR. This protects everyone because the company knows your limits and it is treated as a disability, protecting you from being punished for it, and protecting them from being accused of discrimination because there is a formal record of what you need.
2) You cannot do the job, even with accommodations. Still talk to a doctor, but if you decide that you cannot do this role, you can pursue disability benefits instead of doing the work.
But without those, it's nearly impossible, I can tell you from experience.
If you miss shifts in a restaurant, you're gonna be fired. If a sales rep frequently has to cancel meetings with clients that's a problem. And if you're in middle management you've got a lot of meetings that can't be missed.
But software development is pretty forgiving, and even more so now with remote work. A lot less meetings, a lot more people working highly flexible hours.
As long as you can deliver a full time job's worth of productivity over the course of a quarter, if health concerns make your productivity much more variable so that you've got slower days and faster days, slower weeks and faster weeks -- and that your faster periods compensate for the slower ones -- you'll probably be OK. At least the places I've worked.
If your health problems and pain are such that you can't deliver a full time job's worth of productivity, or where you expect to be frequently missing whole weeks or months due to health issues, then of course that's another story.