A question, have you tried to train her or are you just expecting her being outside to potty train her? Because if you let outside train her its go whenever you want training.
To add to that she isn’t punishing herself inside, she is ashamed of herself and embarrassed. My girl gets so embarrassed when she has to go inside the house. It makes me feel terrible because not only is the a mess to clean up, I contributed to a situation that humiliated my dog.
For the most part its the same as teaching a human appropriate behavior. Kids don’t just learn to use the toilet out of nowhere. It’s called potty training. Dogs are much easier to potty train than kids though, yet it still requires the training part.
Positive reinforcement works wonders.
Also, how often are you feeding your dogs?