For most students they have forgotten that the teacher yelled or that they got in trouble as soon as the afternoon bell rings to go home. I teach grade one and I raise my voice from time to time. I think there is a big difference from being a teacher who raises their voice when the class gets rowdy to one that just yells at students especially individual students. I've seen both types in the schools I've taught at. Rarely have I yelled at a child, but I have raised my voice.
Kids take things in stride.
In fact most of my kids after I've been upset with them want to work extra hard because they don't like me being upset with them. And I have more kids that not who accidently call me mom throughout the year, so obviously I'm not stressing them out. If one child is really acting up I will talk with them privately and at times my voice will be raised and will have an angry tone. For example if they steal from someone or hurt someone, I want them to know I am that displeased with their behaviour. Just being nice and friendly isn't going to make a huge difference.