There generally aren’t financial penalties of any sort in those cases, except that you just don’t get paid the full potential value of the contract. You are generally paid hourly for the work that you do in a freelance gig (if it is an hourly contract) and paid a bonus on completion. If you fail to complete there is no bonus. Or in the case of a fixed price contract you are given a small amount upfront, and the full payment upon completion. You are never penalized for breaking contract—-you just don’t get paid the final amount.