Great question. But what did you mean when you quoted Rashi? - How can you tell that it was Yehudah's bed that needed to be turned over? Rashi says המתאבלים, those who mourn.
I truly don't know who R' Yanai meant if it wasn't Yehudah, though, since he clearly wasn't referring to his daughter. I'm wondering if he meant his own bed, in the common way that people in the gemara refer to themselves in the third person. If he did, it couldn't be an act of mourning for a talmid chacham; one tears kriah for a talmid chacham, but I don't think one observes other mourning like inverting the bed. It could be a case of כל שמתאבל עליו מתאבל עמו (Moed Katan 20b): one mourns along with a close relative [like his daughter] in the relative's presence. Seems like a stretch, though; I don't think the rule would apply when the relative herself is not mourning yet, and as you pointed out he doesn't seem to have asked his daughter to turn her bed over.
I'm waiting to hear a better answer.