Good teachers are good teachers. If the good teacher is an expert, then they are better than the good teacher who is not an expert, especially if they are trying to teach a nuanced topic.
Does every teacher need to be an expert? Of course not. But plenty of non-expert teachers will actually lead students astray by teaching them the wrong model.
I've had plenty of "bad teachers" who were experts. I've also had plenty of "bad teachers" who were not experts. I've had very few good teachers, period. Bad teachers in lower-level topics are not noticed very much, but they are the bane of undergraduates who are subjected to them often. Survivorship bias might lead me to conclude that most experts are bad teachers, but the better explanation is simply that teaching and being an expert in field X are distinct abilities/skills, and that it is rare to find people who have mastered both.
I aim to be an expert in my fields (currently 3 disparate ones in which I hold degrees). I also aim to be a good teacher, which means that I take time to figure out the best approach and experiences for teaching a particular topic. I consider my expert status to be an advantage that complements my teaching ability. Being an expert does not make me a bad teacher. Being a bad teacher makes me a bad teacher.