You seem to be reading about forgiveness of debts, not bankruptcy. When you settle a debt directly with a creditor instead of filing for bankruptcy, the creditor will ordinarily report the reduction to the IRS and it will be taxable as income. (e.g., you have a $5,000.00 debt and negotiate a reduction to $2,000.00. The Lender will report the $3,000.00 difference to the IRS, which will ordinarily treat that $3,000.00 amount as taxable income.)

In contrast, you should not have any tax obligation for debts discharged in bankruptcy - the rule for private negotiation of debt does not apply. The trustee of the bankrupt estate would ordinarily file a tax return for the bankrupty estate as described here.