This is a documented thing! It occurs most often with hearts but can happen with any transplanted organ. It's called 'cellular memory' and I wrote a whole paper on it during my freshman year of uni. It's also why some transplant recipients experience new preferences, thoughts, and sometimes behaviors their donor was known to have. Like favourite foods or drinks, subtle changes in personality (like becoming a bit more daring, etc), and more. It's usually temporary as the organ adjusts to its new person's preferences, experiences, habits, etc. It's fascinating and awesome and I would love to study it in-depth someday.