If someone is indisposed at the end of the game, they can just not show up.
Karlach's dead? Well then she doesn't show up.
Shadowheart works for Shar? Well then she doesn't show up.
Gale's a god? Well then he sends an emissary, or makes a quick cameo.
Astarion can't go in the sun? Avernus doesn't have a sun, problem solved.
Lae'zel is off on her crusade against Vlaakith? She can take a break to go kill Cyric and save Karlach.
Wyll doesn't have powers anymore from breaking his pact? Well he's a ranger or a fighter now. Wyll still has his powers and still works for Mizora? Wyll becomes a minor antagonist, or Mizora also needs to kill Cyric for some reason.
Durge betrayed Bhaal and is now an insane shell of himself? That means that Bhaal has no claim on him anymore, free Jergal real estate. Durge serves Bhaal? Well Bhaal hates Cyric too, problem solved.
I literally just accounted for all major character endings with about 10 minutes of thought. If I can do it, surely Larian's team of writers can too.