Apparently (and not too surprisingly) it’s much more complicated than that. In Washington, police are explicitly forbidden from enforcing immigration laws (“Keep Washington Working” act) and nationally, police could perhaps arrest you for weed but the feds are apparently not allowed to spend any money prosecuting you if you didn’t break state law, according to the Rohrerbacher-Farr amendment https://scholarship.law.uc.edu/cgi/viewcontent.cgi?article=1...
Immigration enforcement is the most prominent today probably.
Local police can arrest anyone for illegally crossing US border and can arrest someone for being undocumented(where not banned by state law), they are just not obligated to by federal law or US constitution.
I agree with you in general but police can do a lot of things on suspicion of a crime. They may have to let you go eventually, but don't overestimate your position. You could be tied up for months straightening out issues with false accusations.