You are supposed to discipline your students.
It’s not a sin.
It’s normal to feel angry when your reasonable directions are disobeyed, as in insubordination.
However, your anger should be proportional to the offense (if you have the urge to grab a gun and start shooting, your anger is not proportional).
It’s not a good idea to use your level of anger as a guide to your level of punishment. Punishment and discipline is best done calmly and rationally.
That said, you’re only human and feelings simply don’t always line up the way we think they “ought”.
Hope that helps.