Did she ever escape from the collapsed Sith pyramid in Rebels? As I remember, we only saw her in the World Between Worlds, and it was quite clear she could only get out the same way she got in, and the first we see her back in the real world is the epilogue, after the OT. She could’ve been down there the entire time, that really seems like the most straightforward answer rather than presupposing she got out earlier, but had another thing that prevented her from participating in the main story.
What we saw in 'World Between Worlds' was Ahsoka fleeing back through the Malachor gate, and remerging back in the ruins of the old city some time AFTER the weapon detonated. How much time is uncertain, but given Ezra seemed to have been gone from his time for about the same amount of subjective time he experienced (give or take) it's reasonable to presume that the same holds true for Ahsoka, since by the time she starts to make her way towards the passage down into the catacombs, Vader has already made his way from the temple back up to the surface.
Back in I think 2016, Filloni drew these for a series of Topps cards that's meant to tell the story of what happened after she went down those steps.
As with the Mortis stuff, this is clearly both literal and metaphorical, but if all one is interested in is the literal side then it seems to go something like: Magical bird leads her through some flooded chamber, up some stairs and though a portal back to the World Between Worlds.
Since it's clearly the Lothal gate she's stepping through, not the Malachor gate, one assumes that means that while the others were back on Atollon, Ahsoka re-emerged at the Lothal temple . . . presumably snuck past the Imperials there and went into hiding.
The metaphorical stuff is pretty obvious if one has a basic grasp of mythic storytelling, but the short version is; she goes on a journey through the underworld ("death"), following the path of light until she ascends back to the world of the living, forever changed. Note that in a lot of ancient myths, water is a symbol of (re)birth, of spiritual change, and as a gateway from one world into the next.
As for why she doesn't show up in the OT: obviously she can't reconnect with anyone until AFTER Ezra re-emerges in his time since she can't risk altering events (because then she'd never have been able to survive Vader.) From the Coda which could take place anything from four to nine or even ten years after Ezra's disappearance; it seems clear that she'd already reconnected with Sabine at least, though we have no clue when (yet!) But she had to have essentially been all on her own (again!) for 2 years at the very least. It could have taken some time for her to be able to reconnect after the allotted time had passed, any number of things could have occurred in the meantime, so it could have happened literally at any point.
It's also worth baring in mind that we see very little of the actual rebellion in the OT. For all we know she was the one that had Hera paged right before Scarif (hell she could have been ON the Ghost!) She could have also been on Hoth for a while before the evacuation, and she could very easily have been at Endor; maybe even with the first wave of landings after the fleet arrived and fought her way to the bunker just as the shield generator blew . . . I personally doubt it, but there's no reason why it couldn't have been so.
I mean we know the Ghost was at Endor, even though we never saw it, so why not Ahsoka?