Deductions & credits

that 21K loss is not a capital loss but a passive loss that for 2023 should have shown up on form 8582.

 

the sale of that property can create a capital loss or gain depending on the sales price, selling costs and adjusted tax basis.  When that property is sold that passive loss is generally freed up.

The adjusted tax basis is the original cost of the property and the cost of subsequent improvements reduced by depreciation allowed or allowable. 

 

we can't see your return and that leaves many possibilities.