Court? You must not live in the US. We got rid of any wisp of legal protection from job termination years ago... It has a catchy name invented by the lobbyists that wrote the laws... “Right to Work”
You become “fire at will” not because the law says so, but because you are not in a union. On the other hand, most unions will still protect nonunion workers.
I’ve never really heard of programmer unions though. Would be curious.
If you can be fired at will, why even bother going through the whole thing in the first place, just fire him.