The Marvel Cinematic Universe does not always adapt stories perfectly from the comics but the asylum scene seems familiar, and not just because of the comparison to "Legion," another Marvel-based TV series that features a character with schizophrenia.
In the "Moon Knight" comic series, by Jeff Lemire and Greg Smallwood, Marc Spector awakes in an asylum where he is told that his life as Moon Knight was a lie and he's been in the asylum since his childhood. He eventually discovers the asylum is fake and those controlling it are ancient Egyptian gods, including Ammit who's disguised as Marc's therapist.
The similarities do not end there. For multiple comic issues, only Marc is able to see what's really going on in the asylum, much like in episode two when no one else could see the Jackals.
This storyline also has a powerful moment when Marc accepts his disorder as he defeats the villain, which would be a positive journey to present onscreen as DID is, at times, stigmatized.
If this storyline is the inspiration for the upcoming episodes of "Moon Knight," it does mean episode five will delve into Marc's past before he's able to escape wherever he is or be resurrected by Taweret.
Maybe Taweret could assist Moon Knight to free Khonshu from where he was imprisoned in episode three, so they can stop Arthur and Ammit.