You sold it, for tax, even though the bank ran the auction
The uncomfortable starting point is that the property was yours, and so is the sale. Even though a bank or its authorised officer conducts a SARFAESI auction and the proceeds go straight to the lender, for capital-gains purposes it is you, the borrower and owner, who transferred the property. So the gain is charged in your hands under Sections 45 and 48, on the full auction price as the sale consideration, exactly as if you had sold it yourself.
The part that feels unfair, and is the settled trap, is that the loan the bank recovered is not deductible. In CIT v Attili N. Rao, the Supreme Court held that when your own property is sold to clear a mortgage you created, discharging that mortgage is simply how you applied the sale proceeds, not a cost of acquiring or transferring the property. So you cannot reduce the taxable gain by the loan repaid. The gain is computed on the whole price, and the tax on it is a further claim on you, on top of having lost the asset.
The stamp-value rule, the surplus, and the NRI TDS
Two more points complete the picture. First, distress pricing does not escape the stamp-value rule: if the auction fetched less than the stamp-duty, or circle, value of the property, then under Section 50C that higher stamp value is deemed to be your sale consideration for the gain, subject to the usual tolerance band. So a low auction price can still be taxed as if you sold at the circle rate. Second, any surplus after the lender's dues are met comes back to you, and a shortfall does not reduce the taxable gain, the gain is on the price, not on what you netted.
For an NRI there is an added exposure that is routinely missed. Because the seller is a non-resident, the person paying, the auction purchaser, must deduct TDS under Section 195 on the sum chargeable, not the flat 1% that applies to a resident seller, and not the bank. In practice auctions are run as if the property is simply sold free of encumbrances, and this obligation is overlooked, leaving both the NRI's unpaid tax and the buyer's TDS default hanging. A practising CA computes the real gain, applies any reinvestment relief that can reduce it, and sorts out the TDS position so it is not left as a liability.