The court cannot order the Government to undo the illegal transactions by sending them to people it did not collect them from, no matter how much it makes your feels more fuzzy.
I can't even imagine the mechanism they would attempt to use. Have every company who ever sold anything with a tariff connected to it go through all their records, then send the government a comprehensive listing of each sale , then the guvmint issuing checks? Or sending the money directly to the businesses then having the business figure it out?
This version of tariffs was just a really bad, illegal idea, and was for all intents and purposes, just a punitive tax that harmed both businesses and consumers.
The best we could hope for was the declaration of illegality, then returning the money to the businesses. So I'm okay with that.