I believe I misunderstood your initial post to be referring to the use of ICE/DHS agents as an exercise of federal police power as we saw in Portland. Thanks for explaining.
To that end, I would point out that the loop-hole to which you refer is just one side of the same coin that allows state-run child and family protective service agencies from doing the exact same thing with children in every state in the Union.
Mandamus actions are the often unthought-of solutions to invoke otherwise unavailable Constitutional protections in administrative proceedings, at least for citizens and legally present aliens.
The Constitution isn’t the only law of the land. We luckily have an expansive common and statutory law in all states. Use it.