The specific situation applied in Burdick.
The court ruled they could reject a pardon given before prosecution thus avoiding the need to testify about someone else. It would be a moot point if the pardon was invalid.
To be clear "they" (who can reject a person) is the recipient of the pardon, not the court.
https://en.m.wikipedia.org/wiki/Burdick_v._United_States
But that's not the relevant part of Burdock for this thread.
The relevant part is that an (accepted!) pardon does apply before indictment.
loading story #42770153