Does sale of rental property create a taxable event?

Can you help with this matter?  

I bought a property with my single ownership LLC in 2019.  It was rented the same year and was always rented.  For tax purposes I filed the expenses/income on my joint tax return every year.  

The tenants moved out in Nov 2023 and I sold the property in April 2024. 

After entering all my personal income and deductions I had a sizeable refund due to my spouse retiring.  

When I entered the income/expenses for the rental and indicating I sold the property, my tax refund swung back to the red nearly 28k!  

I entered the purchase price from 2019 using the asset (165k) & land (30k) values from the first return.  

For the sale of the property I used the 1099-S form which showed the total amount (310k).  I subtracted the original land (30k) value and entered the asset value (280k).

TT pulled in the previous years of depreciation which I changed (by $1000.00) after looking at last years form 4962.   

TT indicates I have a gain of $163k on the disposition of the property.  

I'm not following the math as to how I gained 163k when the difference between the original purchase price and sale is 115k.  

Any help is appreciated.