OY1
Returning Member

Get your taxes done using TurboTax

From publication 550 in irsgov website , is a similar example
Mechanics' and suppliers' liens.

Workers and material suppliers may file liens against property because of debts owed by a builder or contractor. If you pay off the lien to avoid foreclosure and loss of your property, you are entitled to repayment from the builder or contractor. If the debt is uncollectible, you can take a bad debt deduction.

Insolvency of contractor.

You can take a bad debt deduction for the amount you deposit with a contractor if the contractor becomes insolvent and you are unable to recover your deposit. If the deposit is for work unrelated to your trade or business, it is a nonbusiness bad debt deduction.