Well, just for some contrast, that's exactly what the Supremes did in Roe, but a lot of folks thought it was fine. I remain in agreement with Roe's provisions, but it was obviously legislation from the bench, even RBG agreed that this was so. In the intervening years, it would have been great to have Roe properly codified in federal legislation passed by Congress, but nobody had the stones to even try.
In this case though, it's really pretty stupid to argue that the President does not have some kind of presumptive immunity in the perimeter of his official capacities, it is fair to remand for clarification. Call it legislating from the bench if you will, but such is not without precedent.