I'm confused, I thought Madara told Obito to implant his Rinnegan (both of them) into Nagato's eyes after his death. I'm not sure if Madara did it himself, but if that's the case, it could be he implanted later a Sharingan eye (it could be two) on him if he possessed them (which is possible that he possessed other Sharingans, like the case of when Obito used Izanagi on his left eye against Konan, it wasn't his). But I insist on my first opinion and let me tell you why.
In the fourth Shinobi War, when Edo Tensei Madara used Rinne Tensei on Obito to revive himself (Rinne Tensei is a Rinnegan technique that allows the user of the Rinnegan to revive another one in exchange for his life, this is the technique that Madara wanted to be revived with in the first place, Madara said it to Obito before he died, said it again when he was revived with the Edo Tensei that he should be revived with the Rinne Tensei, and even Obito said it to Konan while battling her that Nagato's body was ment later to revive him in case he died) so when he did the technique, Madara was revived (came back to life literaly) and his eyes started to somehow vanish until they are gone, which makes sense, he was revived means that he will come back as he was like when he died, and he died with no eyes so he was revived with no eyes and started to get the originals back (because the ones that vanished were fake, an Edo Tensei Rinnegan, when he got his original right Rinnegan, a Bijuu monster said that this is an original Rinnegan and not a fake one like he had before).
Returning to my first point, I think it's obvious that Madara died with no eyes at all, and therefor Obito is the one who implanted the Rinnegan (both of them) in Nagato's body. Your answer isn't here yet, this is just for clarifying things, your real answer is that you are mistaken in the timeline because when Nagato had the Rinnegan, Madara was already dead and Obito already did the job.