This is a complicated transaction. When you say you sold your partnership interest back at "cost", what does that really mean? Since there is a related party involved, what was the FMV of the partnership interest?
Also, you need to compute your basis in the partnership interest. The starting point would be when you purchased the partnership interest, assumed debt, etc., etc.
Then each year, your basis would be adjusted based on your share of partnership items of income, losses, distribution, separately stated items of income and expenses.
Then, your adjusted basis would be subtracted from the "sales" price to determine gain/loss.
But, there are other items to be computed in the sale of a partnership interest.
Here is a starting point
https://www.irs.gov/publications/p541
Part of what you'll want to review is Disposition of Partner's Interest.
There is a lot to consider. Also look at Effect of Partnership Liabilities, increase/decrease of basis, related party, etc.
Here is a link to some information regarding Passive Activity
https://www.irs.gov/publications/p925
This should help address any losses from Passive Activity in Real Estate.
**Disclaimer: Effort has been made to offer correct information; but due to the discussion forum limitations, the poster disclaims any legal responsibility for the accuracy of the poster's response**