Investors & landlords

You are not understanding how an S corporation works.  Everything in that link impacts your tax situation.  Yes, it can be confusing.

Working with a tax professional could very well be in your best interest in this final year, especially if you find the link information confusing.

Yes it is more complicated than what you envision and lay out in your response.  Since an S corporation in general does not pay tax, all items of income and or loss pass through to the shareholder and this activity impacts your basis.  Every year your K-1 activity needs to be updated on your basis schedule.  Until this is completed, as noted previously, you cannot determine your final gain or loss.
*A reminder that posts in a forum such as this do not constitute tax advice.
Also keep in mind the date of replies, as tax law changes.