You're absolutely right, the environment ('market') matters as much as what you bring to the table ('product'). I've been in similar situations before where I've gone from being highly regarded by one manager to being regarded as average by the next manager. In a situation like this, it's best to change teams. While scouting for a team, pick one that gets a lot of attention from company leadership as they tend to focus their attention on teams with growth prospects. A team with growth will have more room for you to shine.