If a purchaser has an accepted bid and completes a home inspection where Chinese/defective drywall is identified, will the buyer be able to cancel the contract and receive their earnest money back?
HUD homes are sold as-is. This means a buyer assumes risk associated with the property's condition. When submitting an accepted contract, a buyer will execute an Addendum A to the Sales Contract called a Forfeiture and Extension Policy. The terms of forfeiture of earnest money deposits are covered. While defective drywall risk is not specifically cited, it is possible that an owner-occupant purchaser could request a refund based upon the open ended "other good cause" clause.
It is unlikely that an investor purchaser who chooses to not complete the transaction would receive a refund of their security deposit.