If Shadowheart enters the shadowfell with the player but dies before the big choice conversation there, things don't seem to happen as intended. In my case, she somehow fell prone/slipped off the last platform when jumping down, but I'm sure there are other legit scenarios where she could die between entering the shadowfell and starting the big convo there. IE: Seeing what looks like an inevitable confrontation, maybe someone decides to try out one of those fancy hag potions to prep for what they think is going to be a battle and things don't go so well. Anyway, I allowed the bad guy to walk away with what he came for. Then when I got back to camp, I resurrected Shadowheart.
Some of the conversations with SH that followed seemed to indicate Shadowheart experienced things she didn't/hadn't. Online, I learned that the devs decided she was supposed to leave the party if she wasn't present when entering the Shadowfell. In fact, apparently she leaves even if she is dead when you enter and then you resurrect her when you return. But I guess the “death after entering the shadowfell” was an overlooked scenario and is a current bug/loophole. (patch 8)
I eventually reloaded fearing those unset flags might cause issues either with SH or the story progression. I allowed SH to make her choice and then there was a convo that happened when I left the Shadowfell. However when I did, I listened to what she had to say and considered... what if? What if I had resurrected her in camp and the speech I was hearing after her "choice" was the same speech I heard after resurrecting her? And it actually worked really well.
If Shadowheart had been DEAD when the Shadowfell choice happened, whether she died in Act 1 or failed the leap of faith test 30 min earlier or tripped on the way down the hill as she did in my play through or died in the battled with the bad guy... that speech after being resurrected still made sense. Imagine experiencing the would-be after life that awaited her if she failed her goddess. I could totally see her goddess torturing her, not because of a choice she made but because of her failure to complete her mission. And then... boom... Shadowheart finds herself resurrected, saved from her would-be eternal torment and given another chance. Having your goddess torture you in the afterlife is a great way to open your eyes and convince you that maybe you made the wrong choice.
I listened to more of the dialogues with this post-resurrection mindset. There were a few moments when shadowheart mentioned Aylin and her wolf dream... the same things that I noticed that made me aware something seemed off. But nothing THAT out of place. If the line had been skipped and the next line had been spoken, etc.. I wouldn't have even noticed. It occurred to me with a flag that tracked if she was DEAD when the Shadowfell convo happened, it would be relatively easy to kick off the post-choice convo cutscene when she was resurrected and use the flag to omitted select lines from the already existing cutscenes. And it would seem like Shadow-heart changed her faith because of her experience in the afterlife upon failure. There is no reason Aylin wouldn't want to talk to Shadowheart and aid her even if the Shadowfell convo never happened.
When I consider more extreme scenarios like Shadowheart died in Act 1 and you just happen to not resurrect her until after Shadowfell (left her in the care of withers), A nightmare postmortem conversation about the afterlife makes a lot more sense than being chewed out for resurrecting her, doing something she shouldn't have even been aware of and then leaving the party.
So my suggestion is to not simply patch this bug but update the game to allow this "death loophole" as a legitimate alternative. (And fix the other flags that I assume are set when you bring her along so that it doesn't break anything later in the game). And if Larian doesn't fix it, I hope some modder out there makes what I assume would be a simple mod to make these tweaks.