The last Congress that actually made it illegal for the POTUS to fire an official in his Administration was the 39th Congress (1865-1867) on March 2nd, 1867, two days before the 40th Congress was sworn in, and was the law used to Impeach President Andrew Johnson. The bill prohibited the president from removing officials appointed by and with the advice and consent of the Senate without senatorial approval.
The bill was passed again over the veto of President Johnson and became law (Tenure of Office Act) on March 3rd, 1867, the very day before the 40th Congress was sworn in - talk about a power grab.
Although related, but not exactly the same foundation, the Supreme Court ruled against the Tenure of Office Act and the Congress' assumed power to limit the POTUS' power to fire people in his Administration in
Myers v. United States. In that case, the SCOTUS ruled that the President has the exclusive power to remove executive branch officials, and does not need the approval of the Senate or any other legislative body to do so. I'm sure that case would be cited by Trump's attorney's, but I'm not sure it would hold up under these conditions.
IMHO, the Congress does not have the Constitutional power to prevent a President from firing anyone in his Administration - however, they still have the Constitutional Power of Impeachment and they can do that over pretty much anything they choose to say is an impeachable offence.
I think if Congress passes a law restricting the POTUS, the SCOTUS will overrule it. If that happens, and Trump fires Mueller, I think there's a better than 50% chance Trump get's impeached by the House, convicted by the Senate, and removed from office Constitutionally.