I agree with you. Not that there's any way to control this, but I think it's always best to be the 3rd or 4th most advanced programmer on a team. You want to be good enough to get decent projects, but it's always good to have at least two people better than you. I say two because if there's only one "mentor", you'll absorb her biases.
Startup and large company programming jobs are very different. In large companies, being a good programmer is about knowing the tech stack and knowing how to maintain and leverage the code. In startups, new development is more important. I think the better way to go is the reverse of what you described: start at a big company for the learning experience (and seeing, in legacy horrors, what not to do) and then do a startup having learned those lessons. There certainly are lessons about engineering that are hard to learn except in a mature, already-scaled company.
Startup and large company programming jobs are very different. In large companies, being a good programmer is about knowing the tech stack and knowing how to maintain and leverage the code. In startups, new development is more important. I think the better way to go is the reverse of what you described: start at a big company for the learning experience (and seeing, in legacy horrors, what not to do) and then do a startup having learned those lessons. There certainly are lessons about engineering that are hard to learn except in a mature, already-scaled company.