Does working in different area - infra, developer experience, product, backend, frontend over the career period hurt in terms of becoming/staying a staff engineer or manager?
Being a jack-of-all-trades could be either.
If you're earlier in your career, my strong recommendation is to focus on depth. Just master one technology or framework and answer any question about it: This Is How Software Engineers Should Initially Learn.
Two related discussions:
what if these org/pillar/domain hops were across a few companies
I think it's totally fine to switch domains, but the bigger issue IMO is that career advancement will be quite difficult at the Staff+ level if you job hop so much.
See the blog post: Strategic Job Hopping: How to Leave a Job Without Hurting Your Career
@Rahul, what if these org/pillar/domain hops were across a few companies, not in the same company, while staying at the same staff+ engineer level (lateral hire into a different company) ?
It depends on your style. I have seen many several Staff+ engineers succeed in both ways (specializing vs. spreading out). At the end of the day, I recommend striving to fill in the gaps - Find the biggest problem or missed opportunity in your organization and solve it.
From there, see where that takes you. Maybe the biggest gap requires you slotting into the fixer/solver archetype. Maybe it requires you to code across 3 different tech stacks. Maybe it requires the generalist/tech lead archetype.
What I will say though is that job hopping will hurt you a lot as a Staff+ engineer, similar to what Rahul said. At that level, you need a lot of business context and product intuition to continue finding large scope.
Here's another good discussion about this kind of behavior: "What makes a staff engineer from a technical perspective?"