My grandfather spent the last part of his career doing this sort of work—often on classified projects, I'm told. Usually there was an assumption made on the project about the useful working life of any part, and the expected duration of the program, and they made the "right" number of spares.
Things change, and the factory/tooling/people are long gone. Also, often the underlying tech isn't available. But the part needs to weigh the same amount, meet the same guidelines, and fit in the same hole.
It's cheaper to pay someone to spend the time to figure out how to make the replacement then to mothball the entire airplane—almost regardless of how expensive it might be.