This Ivankov flashback is the missing piece to the WCI storyline, just like Mihawk's is to Zoro's Wano storyline.
That's where and when they fit, not now, three arcs and 5 years later.
Sanji already knew the lengths Luffy goes to for his nakama after the Robin fiasco. Even if Sanji didn't think he was as important to the crew as Robin, the second Luffy appeared in WCI, that should've been Sanji's wake-up moment. You can still have him go through the wedding ordeal for the sake of Zeff's safety, but once the conspiracy against Germa breaks out, that's where his character arc needs a conclusion, and that's where Ivankov's words fit: he sees he's loved, he rejects Judge's vision but still protects him and his siblings, and realizes that he's better than his dad and that he has a proper family that accepts him without trying to change him. That's the whole recipe.
Now? Now it feels like an afterthought. Like either Oda didn't have the time to include it in that arc, or that he was holding out on it just for a cheap PU down the line.