It's pretty clear to me that deep knowledge of how the company works and the historical quirks of how things happened, and how the tech-debt works, is considered of only small value to a typical company. I've seen countless examples of people in such positions being discarded without a thought during layoffs.
Additionally, having deep expertise in a particular technical area can protect you somewhat during a layoff, but also makes you easier to define a replacement for if there is more that one of you.
Companies will get what they pay for. They pay for short term gain.