This is an uncommon situation.
Off the top of my head, Im not sure there is a corresponding provision that allows the recognition of a loss on the distribution of the property. Could be wrong though. If not the loss would likely carry through with the property.
You are probably right on the basis since it wasn’t rented out.
A good CPA or tax attorney could help you plan this out, but they’d have to do some due diligence and research.