According to social research, some children do exactly as you suggest. Remember the story about the little engine who thought she could? She chugged up the long hill chanting to herself, I think I can, I think I can. And she finally made it!
People often perform the same way or according to their beliefs. If they have confidence in themselves and think they can do something, they are more likely to accomplish the task compared to someone with a low view of their own abilities.
The concept of overcoming obstacles and bad experiences is based on a person’s belief in their own abilitites. This is called self-efficacy. Anyone (child or adult) with a high sense of self-efficacy is more likely to succeed. The opposite is also true. People with low self-efficacy are more likely to give up in defeat.