This is an actual thing in the US. It’s called prosecutorial discretion. The health insurance mandate is on the books but the penalty was repealed. Illegal immigration was never legal, just not prosecuted. It’s much easier to suspend enforcement than change a law or regulation.Well, Musk seemingly wanted to do it quickly, since it was cancelled less than 1 business day after he replied to a tweet requesting for it to be done.
I am not an expert on this area of law in general but it could be that Trump has the ability to remove the punishments with his decree while he couldn't do so to cancel the whole law, or maybe it was just simpler to arrange this way.
But yes, it seems like a bit strange of an approach