This is actually really funny because I have a character almost exactly like what you're trying to make. My character, Princess Elleen, is a princess who is somewhat bratty in that she hates when people tell her what to do, especially her mother, but has a big heart and wants to be a good princess. Her deal is that she understands her responsibilities, but her mother is hard on her for a variety of reasons. Also, Princess Elleen wants to be recognized for her fighting skills, something that is frowned upon. She learned her skills from her father, the greatest warrior to ever do it, and he spoils her rotten, so between her mother and father, she's got some issues that she needs to sort out.
I tried to make it so that her "brattiness" stemmed from the fact that she wants to be her own person regardless of what is proper, and she resents it when someone, usually her mother, tells her that she can't. Every royal knight that was assigned to protect her either quit or was fired because she refuses to listen to them because she wants to go out and have adventures and she's not afraid to ditch them to get her way. This is played both for sympathy and as a negative in the story: while I'm sure a lot of people can sympathize with how she feels, she goes way too far and feels entitled to getting her way because she think's that she's just. On the other hand, she wants to fix problems that she sees in her kingdom, particularly how women are treated in their society, which is something that she sympathizes with for obvious reasons. One of her staple issues is how rampant child-daughters-to-adult-sons arranged marriages are among the upper class.
So I said all that to say that a character such as yours could do something similar to mine, whereas they're bratty for a specific reason that stems from how unfairly they are treated (or perceive themselves to be treated) due to all the responsibility that they have, but they are genuinely good people at heart.