Wow i dont get why people place kaguya above madara, she has 1 sharinnegan and a almost useless 2 byakugan, madara had 3 (sha)rinnegan. That sasuke mentioned that kaguya's chakra is on a whole different level than madara's doesnt mean she'll beat him.. i seriously think madara beats kaguya with ¡¡3!! (sha)rinnegan.
By the way what if madara knew kaguya was around and did this so he can take her out for good..?
Or he implanted another izanagi in his eye, and maybe he won't even be temporary blind cause we don't know how the rinnegan reacts on an izanagi.. however the time your eyesight is gone will be shortened if you have senju dna.. and madara has all dna possible hahaha
If you were taking a close look before madara got stabbed by zetsu there is a rare focus on his hand that touches the ground, maybe that was a trap or something cause he saw this all coming?