BobKamman
Level 15

What you are doing wrong is thinking rental property is a capital asset, to which the $3,000 annual loss limit applies.  You can claim all of the loss, in the year of sale, on a noncapital asset.

Pub 544 might help (see Page 20).  

https://www.irs.gov/pub/irs-prior/p544--2022.pdf