Clara it tempted to arrogance in her new role as leader. She dismisses Rigsy at one point but then realizes he is the only one with the ability to fool the invaders into powering the TARDIS. A true leader learns from their mistakes. In fact Clara values Rigsy more than he does as she puts herself at risk to prevent his needless sacrifice when he attempts to crash the train. The Doctor is often so busy looking at the big picture that he is slow to recognize an individuals worth. This is one reason he needs a companion. The Doctor dismisses Rigsy completely until Clara shows him the error of his ways. Even the Doctor must question his perceptions. Its too easy to be blinded by biases. When the TARDIS falls on the tracks the Doctor must literally think outside the box in order to move himself to safety. Though in hindsight the solution to the problem seems obvious the Doctor was forced to get out of his own head in order to see it.