I'm definitely a subject matter expert. And I'm able to get pretty deep content into middle school and high school classrooms. And working with smaller subgroups of students is a lot like mentoring junior engineers.
But man, dealing with a lot of kids in the room is a challenge-- keeping the lower third of students motivated; modulating strictness up and down so that you can have exuberance but not disruption; picking up on the subtle signs that there is a problem from outside spilling over into the classroom while multitasking and doing 3 other things. And... just coping when there's an entire class period that felt like a waste and you don't know why.
It is -hard-, and I'm dealing with an unusually easy teaching environment (classes of ~18-20 of well-behaved and academically advanced private school kids). I'm also not a core teacher and so I have the benefit of leaning on other professionals to do the heavy lifting in these areas. I still have hope I'll get good at it (this past year was a difficult one for me to self-assess my performance).
I do think that being an expert/having passion for what you teach is a bonus: if you have students that are already inclined to be engaged, that spark will help a little in getting and keeping their attention. But it is not the most important thing day to day.
Actually, my best performance lately was when I was a long-term sub in science classes teaching subject matter that is not my core competence. I could geek out and learn deeper stuff than I knew about volcanoes and share my surprise with the students, and that felt really good for engagement.
If you are a private school, sure. This is not the case for unionized public schools. Did you hear of that famous case where a superintendent fired multiple teachers for abysmal performance and even abusive behavior and was forced by the courts/union to reinstate them with back pay? It's very eye opening.