And finally, did it occur to you that "just leave and find a better company" is not possible for everyone? Not to mention that most companies are mediocre-to-bad so the "better" companies are a small and very finite pool.
Comments like yours paint a wrong picture and are not helpful or productive.
You seem to have taken the OP's comment very personally, and I'm sorry if you're stuck in a job that forces you to compromise your practice even when you know better. But there's also a (admittedly familiar) problem of a prolonged growth boom flooding the industry with bad engineers that produce fragile work and have poor foundational knowledge.
But, I don't give up. I pitch my bosses research trails all of the time. 90% they don't hit the mark, mostly because I don't try to conform to the whatever roadmap the product team has laid out. But once in a while my ambition and their plan converge, and this is when I get to play out the really cool stuff I do at my job.
You can't have people on a team of 10 all going in their own direction on their own schedule. It's too unpredictable and there are deadlines and contracts to fulfill. And for most commercial software, I don't need the team to research how to do it. We know exactly how to do it. We need the team to execute the plan.
It absolutely sucks, but that's the reality of most coding jobs. At least in my experience.