The case that is most relevant to this one is Marbury v. Madison. While it is usually remembered for the assertion of judicial review by Chief Justice John Marshall in declaring the Judiciary Act of 1789 unconstitutional, the actual case itself revolved around the appointment of so-called "midnight justices" by outgoing President John Adams. Their commissions were not delivered before Thomas Jefferson was inaugurated, and Jefferson ordered his Secretary of State James Madison not to deliver them. Several, including William Marbury, petitioned the Supreme Court for a writ of mandamus that would force Madison to deliver the petitions, an action that was pursuant to the Judiciary Act. Marshall, pointing out that the Supreme Court constitutionally had only an appellate jurisdiction in the case, overturned the section of the Judiciary Act that granted it original jurisdiction in the case of federal appointees. So this obviously set an important precedent for the hypothetical case cited in the question, the events of which are almost identical.