I think the advice to specialise is well intentioned. But it's more suited in the context of marketing and selling yourself. You should market yourself strongly as a specialist if that is what your customer or client base demands. But knowledge is power. So in the day to day reality of your work, you will likely need a broad knowledge base, especially in the long run. So I think it's best to market yourself as a specialist but to build a broad generalist skill set over time, which will help you face any challenge thrown at you.
