Sanctuary cities are absolutely protected under the Constitutional doctrine of anti-commandeering; a direct and obvious and firmly established application of the Tenth Amendment.
The Federal government has to enforce its own laws. The States may voluntarily assist, but the Federal government has no authority to mandate that states, or subdivisions thereof, enforce federal laws.