To be fair, Madara could have easily beaten Gai with limbo that he didn't use for some reasons. Gai also had no way to bypass the gudo spheres by himself. Rinnegan techniques like almighty push, also seemed to have been forgotten by him despite being the original rinnegan user
Like everything revolving around Madara, the Gai fight doesn’t make sense and is retarded. I swear Madara was the touch of death for that manga