I know my answer as mom tends to be whenever the child feels threatened or afraid, or just bad. But is that the right answer?
This might shock you, but I'm going to say no, that isn't always the right answer.
I'm going to put it into context for us. A parent should not provide refuge for a child against discipline.
We might say, Well, of course....but let's look at it in a situation.
When dad disciplines your child, do you let the child run to mom for that comfort to get over the 'trauma' of discipline? Then you've just provided your child the wrong kind of refuge. If your child is running to the other parent after discipline, then they are looking to you for support AGAINST that discipline - it's basically a form of rebellion still, and whichever of you did the disciplining still has a job to do.
Of course I'm talking about the correct type of loving discipline, not harmful. If your spouse is harming your child and calling it 'discipline', then you need to protect yourself and the children, get out, and get counselling. But that situation is not what we're talking about here.
We're talking loving, correct discipline.
Let me add, too...if your child is still looking for comfort after discipline, then your discipline isn't finished. Correct discipline ends with the child being happier than they were before the discipline. Why? Because their relationship with that parent is restored. Correct discipline ends in forgiveness. They don't need comfort from the other parent when forgiveness and restoration has happened.
So what do you do if your child is running to you as the 'other' parent? You gently take them by the shoulders, point them at your spouse, and say they still have some business to attend to with that parent. They need to ask the disciplining parent for forgiveness. You aren't doing them any favors by loving and hugging on them right then yourself. You'd only cement in their mind that they were UNFAIRLY disciplined. Yes, that's what you're telling your child, and your child has just successfully pitted his parents against each other. Don't fall for it.
Don't be providing a refuge to your child against proper discipline.
Second, don't provide a refuge against natural consequences of disobedience (short of physical harm, of course.)
This also counts for me as the natural consequence of just impolite behavior.
So, let's look at this in light of the way we react to God.
When God allows something in our life that we don't understand, don't enjoy, something that gets us downright angry, what do we do? Do we look to other people for comfort (commiseration, justification of our actions, etc.)
Or do we go back to God, humble ourselves, and quietly ask what He'd have us to learn?
I know half the time I'm guilty of wandering around with questions in my head, or complaining to friends, when instead I should be doing just this - talking to God about it.
Let God be your refuge, even from the things He Himself has allowed in your life.