Punishing a 5 year old

Eva💋 • Hello ladies! Let`s talk!
Ok so my daughter is five years old, and she has been misbehaving in school (not listening and talking when she shouldn't be) she is currently in childcare but they also teach the children. She will be starting elementary school in August. I have had to talk to her on more than one occasions about her behavior. So today I finally whooped her on her butt and put her on punishment for the rest of the evening. Is this to harsh for a five year old? She isn't usually a bad child but I know she is bossy and she truly believes only her parents can tell her what to do (she actually told her teacher "you can't tell me what to do") I just really don't want this behavior to continue in elementary school.