Of course it's not legal. OP's property was damaged by store staff.
Also, in the US there's implied merchantability warranties, and most people have no idea it exists. If your expensive high quality headphones die a week after the one year warranty ends, implied merchantabilty still applies, because people expect headphones to last several years if treated appropriately.
OP needs to go back to the Apple store and say "I came in with a working airpod and case, and left with nothing working. Please make this right."
If they refuse, say "my next stop is small claims court for your staff damaging my property."
I have no idea how a case like this would play out in the US. But it certainly feels like something that should be illegal.