This is a commonly held view - particularly among employers. And certainly some people can do it.
But the problem is that it takes time to build expertise and bargain that into something you can live on. And the more times you have to do that, the more you fall behind people who found a niche or a long-term role and stayed in it.
And you eventually find yourself in your late fifties, steamrollered by yet another wave of change, and you don't have the time or resources or energy, or just plain self-belief, to adapt again.