This didn't happened to Luffy at any time.
Everytime Luffy had the opportunity to fight Doflamingo and get used to his abilities, he did better than previous times, until a point where they were fighting in equal terms up until Gear 4 started overwhelming almost everything Doflamingo pulled up against him.
But with Law, nope, he didn't, blud kept losing the fights until being called weaker, despite being someone who was hinted to know about Doflamingo so damn well, then being stated to have no chance and losing an arm, almost dying in the process.
In the way of giving Luffy the protagonism against Doflamingo (someone who has everything to do with Law's character arc), he made Law look like shit and simply weaker than Mingo everytime they had a 1vs1.
This could've been solved with Law simply letting Luffy take the fight, by Oda making Law get busy with something just as important to him. But its goofy, Oda drives the whole plot to wank him, right? It's Nika Piece now, Luffy = Messiah