> how do you avoid being assigned this role and remain a valued engineer once you have experience?
Change company.
If the only progression for an engineer is to become a manager, change company to one that allows an engineer to continue growing, continue learning, and continue to earn more.
Some signs a company will force you to become a manager to progress:
1. Artificial ceilings: "We have Principal and Staff Engineers, but those are defined as having had impact outside the company so you cannot become one as your work only has impact internally" - effectively these titles are only offered to strategic hires and it's not attainable from inside the company
2. Managers paid more than the top engineers.
3. Title inflation as this stifles actual growth and learning and tends to limit overall earnings forcing you to look to change your career to find new challenges and earnings even though you want to be an IC and continue to do engineering.
Unless a company truly has a clear progression for ICs with learning, growth and earnings all factored in, and that the IC progression goes all the way to near the top of the company, and it's achievable within the company... then you're going to reach the point that you'll look at the manager career and think it's the only way forward. It isn't, and it's not even forward it's to the side and backwards a bit (you reset your career and start at the lowest level of a new track).
If you can't progress as an engineer and wish to... change company.