Almost immediately after Donald Trump announced (via tweet, of course) that the role of "acting" Department of Homeland Security Secretary would be filled by Customs and Border Patrol Director Kevin McAleenan, after the resignation of previous department head Kirstjen Nielsen, experts weighed in to point out that technically that move would be illegal. Trump does not have the power to put McAleenan in the role; statutes are explicit in the order of succession, marking current undersecretary of management Claire Grady the acting secretary until such time as the Senate confirms a replacement.
Given that Nielsen's resignation itself seems to have come about after Trump began to throw tantrums, demanding Nielsen take illegal actions against asylum seekers, the news that Donald Trump does not particularly care about the difference between legal and illegal things is not surprising. It's also quite possible that literally nobody on Trump's team bothered to even find out what the legal order of succession would be until after Trump's tweet—or that if they did, they did not bother to tell him.
Unfortunately for Undersecretary Grady, however, there's exactly one way for Trump to get what he wants here. He just has to fire Grady too, while he's firing everybody else. It's looking like that's exactly what will happen.
“She has no protection from removal. So, the only cost is a political cost, but I hope there will be a political cost,” [Stanford Law Professor Anne Joseph O’Connell] said.
We don't know whether Trump was already planning to fire Grady when he announced McAleenan, but now that he's done it it seems almost certain that the White House will boot her quickly so that Trump can save face. Trump appears to be clearing the Department of Homeland Security (including the Secret Service) of anyone who has been insufficiently supportive of his irrational, sometimes-illegal policies. We can only assume that the move is in preparation of installing new figures who will be less hesitant to carry out White House orders.