What ginjutsu would work on 8 gates guy her simply hit him with the evening elephant and be done with it. Rinnegan madara couldn't get him in a ginjutsu what makes you think lobster armor madara would?
Did Madara try to cast Genjutsu on Gai? No.
Did Madara enjoy the Battle ? Yes.
Did Madara try to Fightback with his Powers against Gai? No.
That fight was nothing more than a tribute to Gai, Kishi showed how strong the Technique is, but in the end it did completely nothing, apart entertaining Madara.
Your Argument is Invalid. Only several People are resistant to Genjutsu, GAI IS NOT ONE OF THEM.
If Genjutsu was able to K.O Raikage it will K.O Gai if there's no one to cancel it out.
It's simple as that, You have to realize that Things are not always how you see them, they have a deeper meaning, so did Madara vs Gai fight.