“To almost everything you suggested.....no, that isn’t the way the law works.”
It all works.
The president can fire or suspend Homeland Security Agents that abide by the court order and he can Pardon Homeland Security Agents that refuse to follow the judge’s order.
He can also install Military Police to take the place of the dismissed Homeland Security Agents.
The Office of Field Operations for CBP, the people you want to replace, numbers more than 20,000 people. You have to dig up that many MP’s and then train them to do that job. That would take longer than this case will take.
Might be a good way to clean house.