I'm a former high school teacher. By far the most effective science and math teachers at the school were two men with doctoral degrees for whom teaching was a second career. They had spent 2+ decades contributing to their respective fields and were now teaching. They were miles above the rest of the department in regards to understanding their material to the core, and being able to explain it. Their deep understanding of the scientific method and mathematical reason allowed them to go beyond the surface memorization that is so common in schools.
It's unreasonable to ask a truly gifted engineer or scientist to enter teaching at the prime of their career, and we shouldn't. The world needs their brains to push knowledge and innovation forward. But our society should encourage them to consider teaching as a second career. It's the only way to stop the cycle of misunderstanding and poor teaching that has led to our current crisis. It's a win-win situation: our students benefit, and our society can still reap the benefits of gifted minds.