A few years ago I gave a talk at a university discussing this very topic. My view is that you should focus more on an "arrow" shape:
- become a senior with one topic (you don't have to be the ultimate master on this)
- have mid-level skills on topics surrounding that one main skill
- have a junior-level skillset on the outlying topics
- have some knowledge of anything beyond that
For example: a back-end developer should be really good at back-end development but they should have a very good understanding of the front-end, DevOps, and DB as well. They should have some rudimentary understanding of how UI/UX works and system administration as well. Beyond that, they should have basic ability to understand what's being discussed regarding product development, marketing, how the OS works on bare-metal, etc. etc.
I feel like that makes a more well-rounded employee that has an easier time moving around their space, understanding their co-workers, and, worst comes to worst, shifting to a new topic when it becomes relevant.