So when the producers found this out I beleive they asked her ( she may have asked them).
All through Season One she sent messages via LeVar Burton that she wanted to be on the show, and they all assumed it was Whoopi being a prankster. When she heard that they'd just lost a female cast member (Yar), she made more serious efforts to be heard.
Sadly for Marina Sirtis, any time Whoopi notified Paramount she was free to do an episode, often a very short notice, it was usually a key Troi scene that was hastily rewritten for Guinan.
You can also sometimes tell where a Whoopi scene was written, and she was suddenly unavailable. For example, Ben, the young bartender in "The Lower Decks", gets to play Guinan's lines in that episode.
Actually, that change was probably for the better, given the nature of the episode.