In the context of a company, the higher up you get (on a technical track), the more you need to operate across different projects, technologies etc. - being able to jump into new things is mandatory/expected. But having deep knowledge in something important to the org gives you a foundation on which to succeed. I would say that specialising perhaps allows you to stand out more efficiently as a lower level IC.