Police don't need immunity to carry out deportations, only orders to cooperate with ICE and ICE being run by an administration that wants to deport those here with neither a visa nor a legitimate asylum claim.
Police already have too much (qualified) immunity, which is what leads to them shooting non-treatening dogs, using pretextual traffic stops to harass black folk (yes, they do that disproportiontely in comparison to the share of their population, though they do not shoot black folk disproportionately to their share of the population), misusing asset forfeiture to seize property of people not even accused of crimes, facing no consequences for serving no-knock warrants at the wrong address, and a whole lot of other bad behavior. Giving them another layer for immigration enforcement will have the result of Hispanic folk here legally being harassed because it's easier just to go after folks who look like they came from South or Central America, rather than actually figuring out who really is here illegally.
You raise good points. Simply give them the power to enforce the Law, cooperation in doing so from the Federal Agencies which have not been doing their jobs (even if that takes some changes in personnel and force structure).
There are things we do not want police to do, and 'immunity' should not be extended nor expanded to the degree there is no accountability. That said, nonsense like the 'St. George of Floyd' trials should never have occurred. Naked Pandering to false narratives to 'win' the support of people who have been misled, even in the face of threats of violent behaviour, should never be tolerated, nor should the falsehood leading to incitement to riot be tolerated by anyone, regardless of office, press pass, occupation, or social status.
We must be careful not to braid the rope that will be used by our enemies (and those of the Republic) to hang us if they get the chance.
Power corrupts, absolute power corrupts absolutely.