Yes. Sometimes patients will receive heart or liver transplants but die anyway within a few weeks. In very rare cases, the donated organ was still healthy enough to be worth re-transplanting to a new patient.
In 2012, a 27-year old man from the US received a kidney transplant but then had it removed again two weeks later because the disease he was suffering from was damaging the kidney. Doctors rescued it in time and gave it to a 67-year old man instead, and returned the first patient to dialysis treatment