The general rule is this: courts will not enforce illegal bargains. The parties are left where the court found them, and no relief is granted: it’s a hands-off policy. The illegal agreement is void, and that a wrongdoer has benefited to the other’s detriment does not matter.
For example, suppose a specialty contractor, statutorily required to have a license, constructs a waterslide for Plaintiff, when the contractor knew or should have known he was unlicensed. Plaintiff discovers the impropriety and refuses to pay the contractor $80,000 remaining on the deal. The contractor will not get paid. 1 In another example, a man held himself out to be an architect in a jurisdiction requiring that architects pass a test to be licensed. He was paid $80,000 to design a house costing $900,000. The project was late and over budget, and the building violated relevant easement building-code rules. The unlicensed architect was not allowed to keep his fee. 2