Luffy was too young. Had he kept training under Garp, who knows what he could have achieved already being a marine.
But the thing is,
The strenght of the master doesn't mean the student will get stronger just for that. Hyogoro helped Luffy achieve the adv. haki. Rayleigh didnt. He went "let your Haki bloom as you fight more powerful enemies. Hyogoro was like "nah fam, here's how you do it. this is the theory, now start practicing."
There are merits in both methods, But a weaker character made Luffy go beyond.
All of that is to say that, despite Sanji having "the weaker teacher", doesnt mean his training was "easier". But as Oda portrays, it indeed didn't have the same impact it had with Luffy and Zoro.
Which is BS in my opinion, but that's how it goes.