First and foremost, massive sympathies on your partner's plight. It sucks, it's stressful, and has real world impacts.
To your general question, I feel it's a variation of the "why do bad things happen to good people", and philosophically we (humans) do not have a satisfying answer that I've ever arrived at, especially if you're not religious :(
To your more specific question, it seems that like myself and probably many of us here on HN, you approach large corporations as a meritocracy and you assume that key skills / merits are the ones that produce, create, support, deliver to customers, etc. It is my observation that these are loosely correlated with corporate success. There is a specific set of skills that are more associated with corporate success, including crafting your perception/eminence/image with key people, networking, being aware or appearing to be aware of the big picture, strategy, finances, and true goals/product of your company, as well as clever career management. Even many people who are aware of the required skillset, and are in principle capable of acquiring said skillset, struggle to put it into practice - it could be due to ethical frameworks, personal preferences, or just a hope/belief that "it shouldn't be this way" (For better or worse, I largely count myself in that group).
One of the things I've observed in myself and others: We assume it's our job to do a good job, and our bosses' job to notice and reward a good job. In North American corporate, that rarely works, particularly in remote, fast changing scenarios. Your boss is a human being and will notice some people & activities, and not notice some people & activities. If you care about your career, "Managing Up", taking control of your career and image in the way that your corporation requires (not "the way that I think should work in ideal world":) is, for better or for worse, key success criteria.
Note: I would NOT fall into the easy trap of saying "These are not smart people"; that leads to underestimation / expecting results from them which differ from reality. They may or may not score highly on a standardized IQ test, they may or may not have the same kind of intelligence and knowledge as you value, but clearly they are "smart" in some specific ways, and clearly very practical/useful ones.
All the best to you and your partner!
Very insightful comment, thank you. I do agree and tend to critize the discounting of other people's intelligence when I read similar things (there's usually a lot more to it), but that one dude in this case really is a disaster, exceptionally so. Your argument stands however, and while I think you've written down from many years of experience looking back, it does make me sad a bit that this "assumption" is not what companies strive for, because I do believe it would ultimately be rewarded in success: "We assume it's our job to do a good job, and our bosses' job to notice and reward a good job".