I empathize with your frustration with your wonderful 2.5 year old. It has been a long time for me. My grandchildren are now older than your daughter. I have a few suggestions that you might consider. If we think of teaching/training our children in terms of discipline, rather than punishment, that directs us into thinking creatively about what actions will move us toward the outcomes we want. In other words, actions that more closely fit the misbehavior than using "one size fits all" punishment of spanking, yelling, grounding etc. Spanking can be useful in a few select situations, I believe, but for most of our training of our children, I think other methods work better for our overall goals for our children. If our goal is to raise our children into happy, well-adjusted, caring, responsible, capable adults, physically, emotionally, intellectually and spiritually, WHILE maintaining a loving relationship with them, then I think we might want to think in terms of discipline, rather than punishment. Discipline connotes decipleship, teaching; while punishment brings to mind might or power, especially if the punishment is in the form of hitting--"I must see that you feel pain in order for you to learn the correct behavior".
Another sort of overriding thing to remember is how children move through their stages of physical and emotional development. Around 2 years of age, children begin their first displays of behavior designed to help them ultimately separate from their parents. Hopefully they are able to grow up and leave us without too much trauma. Babies and small children are totally dependent on us. The process of separating successfully is a long one. I see the 2's and the teens (the second major separating stage) not as rebellion, but as evidence that they are on track developmentally. If they always "idolize" us, leaving home will be traumatic. Some kids go through these periods relatively smoothly, and others go through painfully and I believe we, as parents, can have great influence on which way they progress through these important stages of development.
Another concept that was useful to me in raising my children and in working with the parents during my career is the principle of natural and logical consequences of behavior. Natural consequences are those that will be in place without our having to do anything. If a person goes outside in cold weather without a jacket, they will get cold. Logical consequences are those that are put in place by someone in charge (parents) and they match or relate to the particular form of misbehavior. These are sometimes tough to devise for parents because we need to have thought them through before the behavior happens and it is not useful for us to use logical consequences when we are angry--our behavior can be misinterpreted by the child as "mean" rather than "loving and teaching". Logical consequences, to be successful, must be used consistently and firmly (not angrily, coldly). An example of a logical consequence might be: "Your behavior is inappropriate (and yes, a 2 year old will learn quickly what inappropriate means) and you must be in time-out in order to think about a better way to act (you may state specifically what the behavior was and should be)". Twenty minutes is too long in time-out for a 2.5 year old; more like 2.5 minutes, with the statement, "Let's try again." Statements such as that at the end of a time-out, send a message to the child that you believe they are growing. changing, and learning correctly. Patience for parents in one of our greatest challenges throughout their childhood. Especially after a sort of "power struggle" has developed.
Also, giving children choices between 2 things, both of which are OK with the parent helps a child feel the appropriate amount of autonomy for their age. "Do you want to take a bath now or when the timer buzzes (in 5 minutes)?" "Do you want to wear this shirt or that one?" "Do you want to pick up your toys by yourself or do you want me to help you?" "Do you want me to kiss you goodnight now or in 5 minutes when the timer buzzes?" "Do you want this for a snack or that?"
There are two books that were written some years ago that deal really well with the concepts stated above. The oldest is by Dr. Rudolph Dreikers: Children: The Challenge and a later one by Matthew McKay (who was Dreikers' student): Raising Responsible Children. Both, much like the Bible, are old, but still very applicable to our lives as human beings and as parents. Good luck to you. I applaud you for reaching out in your frustration with your endeavor to be an effective parent. God bless you.