According to publication 535 from the IRS, you must show you claimed a ‘bad debt’ as income first, and since freelancing is a done as a cash basis where you do the work first, then record it in a ledger upon payment (rather than recording it in the ledger upon billing), the income hadn’t happened yet. Basically, money owed to you for services performed, but never paid, cannot be claimed as bad debt.