Slammie, just throwing out some ideas based on sudden change in behavior with dd4.5. We have had phases where she is just so stubborn, disobedient and destructive. Here is what has worked/were the causes:
1. Growth spurts
2. School fatigue/mismatch- she is in a play based preschool but she had a very bad phase in the beginning of the school year. I ran out of all options and one day, just sat her down when she was in a good mood, explained what I am observing (facts, no judgement) and how I miss my happy child. I then asked her what was bothering her. She hated going to school 4 full 6-hour days. She wanted more time with me in the homeschool. I changed my hours at work and she goes 3.5 days now. As soon as we both discussed and agreed to a plan, she transformed back to my delightful child. Like your dd, mine loves friends and school but she can only control herself for so long.
3. Need for more physical activity: my dd has to move, all the time. She twirls and jumps constantly when she talks about things she is passionate about. School tries to control that behavior as it is disruptive to the class. When she comes home, I let her jump on the couch and run around the house to her hearts content. Now that warmer weather is finally here, I take her out and let her ride her bike, climb a tree, etc. she just needs to let it out, she is much calmer child after that.
I hope at least some of this is relevant to your situation! Hugs and this too shall pass.