Since several trained people have told you this is normal rebellion I urge you to find ways to handle this rebellion. Sounds like you've gotten into a power struggle with her.
I'd try leaving her alone for the most part. Have a few firm rules that you enforce in a calm manner. A counselor recommended to my daughter a course of action when she was having difficulty getting her children to mind.
She said to send them to their room when they refuse to do as told. It's similar to a time out but not. They can play in their room but they can't come out until they say they're sorry and then do what they've been asked to do. No battle of wills here. Just a quiet enforcement of the one rule that is if you're not cooperating you're in your room.
At first, my daughter had to take them to their rooms. After a week or so they went on their own most of the time. That first week or two is rough. You have to be consistent and calm. No anger on your part while allowing your child to express his anger appropriately. He can yell and scream but he goes to his room and stays there until he's able to say sorry and do what is asked.
Do not do this for potty accidents unless it's intentional. If she's upset she may not be able to control her urine which would qualify for some sympathy. If, however, you can see that she's done this intentionally, then do send her to her room until she's willing to help clean up the mess.
When you tell her how you're going to handle her anger and refusal to cooperate be gentle and sympathetic. Tell her you know this is hard for her. A therapist once used this phrase with my daughter and it helped our situation alot. She said, "it sucks to be you. I know you're having a hard time."
When she's being calm and cooperative give her lots of positive attention. Give lots of hugs and praise. Make time to do things with just her.
The fact that she does well elsewhere certainly is an indication that she's acting out at home because of jealousy. Combine the jealousy with being 4 and trying to find her way to some independence and you have rebellion.