You're right that--especially in the tech field--things move fast, and you need to be ready to shift to and/or develop new specialties. However, I've found that when a company invests a huge chunk of cash to implement a system, there's a vested interest in wringing out as much value for as long as possible. Because of that, you can stay in a niche longer because the technology churn rate is slower.
Now, if the niche is profitable, like you said, it will attract competitors despite barriers to entry. Even so, you can still maintain your market share and continue to grow your business if you've established yourself in the niche. This may apply more to very small niches, but even in very small niches, there can be good money to be made.
For my particular niche, I've been self-employed in it for over 5 years, and am still growing my client base and business--despite newer competitors entering the space--partially because of my depth of knowledge and partly because I've specialized within my niche (instead of focusing on something general like software implementation, I focus on creating customized automation & reporting).
It depends on the particular niche though, so your points are well-taken.
Keep Up with TechRepublic