Sure, but why? Why wouldn't you have a direct, honest conversation with your manager?
I'll tell you why.
Because it can be terrifying.
You don't know how they will react, whether you'll be forced off interesting projects, put at the top of the layoff list, or similar. You can watch how they handle other situations and get an inkling, but you don't know.
Good bosses won't react like that and there are many good bosses out there who want you to grow and will work with you to achieve your goals. But there are plenty of bad bosses too.
From this perspective, it's a lot easier to just pack it in, write off the boss and company, and find a new job. It's less satisfying, to be sure, but less terrifying.
It's taken me a long time to realize how important it is to have a boss you can have a direct conversation with. It's also a factor of my experience and knowledge of my self-worth too.
If I were a new developer in my first job, it'd be a lot harder to have a tough conversation with my boss, because my alternatives would be fewer.