haha, yeah, He made himself just like an enthusiast foolish kid .. He wasn't in his best stage , he should have wait and play with other shinobi while zetsu bring the rinnegan , and then he should attack ... the way he did , He almost got killed by his own useless action .
but by attacking the bijuus, and by damaging Madara , perhaps Kishi wanted to give shinobi alliance "a little HOPE" and making a better entrance of rinnegan .