It might "just" be constipation leading to encopresis - see the doc again.
Some ideas. Perhaps something ledical is going on and I would rule that out before taking any action. Perhaps it is anxiety. Perhaps she is forgetting and is using excuses becasue she is embarrassed. Perhaps she is seeking out attention! Rule these out one by one. Im sure you will find the answer and it will pass! Hope this helps!
My son has been complaining of a stomach ache. He prefers not to eat, which is not normal for him, put when bribed with outside playtime or a treat... he eats his meal (the portion we had compromised on). This has been going on for a week or two, we thought that he was just going through another growing stage. I never really put it together until now that he had been having small accidents (feces) in his pants. Just enough to make it more than a mark and to leave a foul odor. I've tried everything and thought of the psychological possibilities. We are making a doctor's appointment tomorrow morning as well because it's becoming more frequent and he seems to feel ashamed of it. I believe he really is trying not to go in his pants, but that he can't help it. He'll be 6 in August and has been potty trained without a problem since 2 years old. Yesterday he wet his pants a little too?! I don't know if I should bother a pediatrician or psychologist or if it's just a phase? I think that he gets distracted easily during playtime, but while he was with my sister for three days... he didn't have an accident. We showed up to pick him up, and within minutes his pants were soiled! I am going to try counseling to see if there is something more we can do.
I would check to see if she has a bladder or kidney infection. There's also the possiblilty of her having H.Pylori (a bacteria that attaches to the lining of the stomach). I have been having problems with that one myself. Although that doesn't explain the bathroom problems.
One other possibility is anxiety. Could she be stressed about something? My daughter when she was little would say she had stomachaches a lot. I found out she was usually anxious about school. She would get stressed if she forgot her homework, if the other kids were teasing her or if the teacher would be strict, etc.If your niece checks out fine physically, look into the possiblity of anxiety, and see what can be done to relieve some stress. I could be way off here, but it's just one more option to check out. Hope they find out soon!