Depreciation Recapture

This is for 1120S. The original cost basis of the vehicle was $35,000 in 2018. In that year section 179 and bonus depreciation was used in the amount of $18,000. Safe harbor was not elected in the subsequent years and therefore no further expensing/deductions were used. In 2022 the vehicle was replaced with another vehicle. $23,000 was received. Is it correct that the corporation needs to recognize a gain of $6000 on the return for 2022?

 

Thanks for your help!