Knowledge depreciates, so it is clarifying to add time explicitly: I thought this knowledge would set me apart...
Forever? That seems over-optimistic for all occupations in all eras.
For the rest of my working career? This really hasn't been true in a long time either, especially in software, where technology changes on the order of years.
For the duration of my mortgage? The fondest hope, but pretty much like the above.
For the next 10 years? Here is the big change. Even for fields like medicine, where knowledge really did set you apart. The AI can adapt faster. AI is inside the human OODA loop.
May be for OO not yet for DA. Existential pressure drives better(fruitful) decisons and actions. AI has yet to incorporate that into training/inference.
The good news I think is that you have to be really really specialist for the specialist knowledge to actually be the important bit; for most it's the ability to obtain specialist knowledge, and apply it.
As long as we can adapt, move on to the next knowledge-needed area, we'll hopefully be alright.
(I think there are many analogies here to things people have always said about undergraduate study – e.g. it's about teaching you to learn, not teaching you the specific things you're taught, to be remembered and applied forever.)