Bought the house for 289K in 2013. Cost basis entered in TurboTax was 150K which is the building value, which is what I have been depreciating for all these years.
Total prior year depreciation 42K.
Sold in Sept'22 for 428K.
Turbotax is calculating gain based on the sales price 428K minus the 150K cost basis which was the building value not the full purchase price.
The land is not depreciable, so your depreciation deductions are correct, assuming you entered the correct cost of the building. However, you do need to add the land cost in TurboTax as part of the rental property asset entry, just designate it as land so it won't be depreciated. When you report the sale of the property, the land cost will be deducted to arrive at the gain.
So, go back and edit the property entry and add the land value to the cost, so that the total cost reported includes the cost of the land.