Some people are upset that Sanji is pushing Luffy away like Nami and Robin have both done in the past but I think there is a difference between them.
I think Sanji knows Luffy could take down his family and Big Mom where as Nami and Robin both had doubts earlier in the series. While he doesn’t want his friends to get hurt saving him I think he wouldn’t have an issue accepting their help and taking everyone down if not for one thing-
Sanji has 2 enemies that he knows Luffy isn’t going to be much help with.
2. An unidentifiable threat
If Sanji resists judge, his wrists can be blown off before he even has a chance to explain the situation to Luffy.
Also he has no idea how the order to kill Zeff is going to go through and Luffy sucks at information gathering and espionage and Sanji really can’t make a move till Zeffs Safety is gaurenteed.
With this in mind Sanji doesn’t have much choice but to send Luffy and Nami away and hope they don’t give up on him and learn more about his situation to help free him from his more personal threats.