One of the many reasons why DHS is the worst possible agency to be carrying out these kinds of occupations is that they've basically been trained to understand that they're not really subject to oversight. Like, at all. This plays out in a couple different ways.
Police know they have to keep records and reports of what happens because their work will form the basis of a longer legal battle, subject to rules, laws, the constitution, etc. A bad report could mean a guilty person walks free. They know if they don't Miranda someone, it's over
Anyone who has engaged with ICE/CBP knows that their records are notoriously spotty (to be generous). Many if not most of my interactions with the agency have not been documented in any meaningful way.
CBP knows they can carry out a deportation along the border and that there's virtually no judicial review. They can basically do what they want.
Even the military has disciplinary proceedings, courts, and the possibility that a solider could do jail time for war crimes *exists.*
Here's an example of the kind of documentary rigor and oversight at CBP: https://www.sandiegouniontribune.com/news/immigration/story/2019-11-07/cbp-fraud
If you're a dirty cop, you know ultimately that your work will be reviewed at least by a public defender and a judge. Some may argue it's not a wholly effective backstop but it's a back stop.
If you're a dirty CBP or ICE officer, your work is either reviewed by literally no one (the immigrants don't even get copies of their own paperwork most of the time), sometimes by an ICE prosecutor, or a Judge who used to be an ICE prosecutor...
...and it's only reviewed by a defense attorney if the immigrant can afford one. Oh, and only if you/your agency decides to hand over the evidence willfully or through a FOIA, because in immigration proceedings there's no such thing as discovery!
This is not to say that criminal defendants don't get railroaded all the time, they do. It's not to say that the military gets away with committing war crimes, or that cultures of corruption don't exist in both of these institutions. Of course they do.
At DHS there's just zero institutional accountability. No fear of being subpoenaed or developing a bad rap with a judge, or being disciplined for filing a false report, etc.
Here's a story of a local ICE prosecutor who got caught *falsifying documents in Court* in order to get a man deported. https://www.seattlepi.com/local/crime/article/Prosecutor-who-lied-to-get-man-deported-Why-7265443.php
He worked many years at ICE. There is zero chance that he did this once and got caught the very first time he did it. He was in the court room probably thousands of times going up against unrepresented immigrants from Central America who would never have an attorney.
His boss decides there's no need to conduct an audit, nothing to see here. And guess what happens to the boss? He later gets caught stealing immigrants' identities: https://www.seattletimes.com/seattle-news/crime/former-ice-attorney-pleads-guilty-to-stealing-immigrants-ids-to-defraud-credit-card-companies/
In other words, even when ICE gets caught red-handed by a savvy attorney, or the criminal justice system, there's no followup investigation.