That's not the issue.
The law that creates and funds the Department of Justice stipulates rules for vacancies.
It is possible - just barely - that this law requires the most senior Senate-confirmed official at DOJ (Rosenstein) to act as AG until Trump nominates, and the Senate confirms, a replacement.
The Court would not force Trump to appoint Rosenstein. The Court MIGHT declare that, under the law, Rosenstein is AUTOMATICALLY Acting AG.
In which case it is, in my opinion, unconstitutional for article 2 separation of powers reasons, unless there were some incapacity of the president.