The chapter "A Ghost in the House" unfolds within the rigid and somber environment of the Sesemann household in Frankfurt. Following the departure of Grandmama, Heidi finds herself trapped in a state of profound melancholy. While she spends her nights reading, her spirit is clearly fading as her longing for her grandfather and the mountain intensifies. This emotional suppression coincides with a series of "strange and mysterious" events: the front door is discovered wide open every morning. Despite the servants' attempts to secure it with a "wooden bar" and double locks, the phenomenon persists, leading the household to believe in the presence of a "ghost" or unwanted intruders.
Miss Rottenmeier, overwhelmed by fear and the belief that the house is haunted, summons Mr. Sesemann back from his travels. Upon his return, he enlists the help of his friend, the doctor, to investigate the supposed haunting. The two men maintain a skeptical, rational approach, laughing off the superstitions until they hear the distinct sounds of the door being unbarred at midnight. Their investigation culminates in a shocking discovery: the "ghost" is none other than Heidi, standing in her "little white nightgown," her eyes "wild" and her body "trembling from head to foot like a leaf in the wind." It becomes immediately apparent that Heidi is in a state of sleepwalking, completely unaware of her actions.
The doctor, acting with compassion and medical insight, tends to Heidi in her room. Through his gentle questioning, he uncovers the root of her condition. Heidi reveals that she suffers from recurring dreams of being back with her grandfather, hearing the "wind in the fir trees," and seeing the stars. When she wakes, the reality of Frankfurt creates a heavy, suffocating sensation—what she describes as "a big stone" on her chest.
Crucially, the doctor identifies the source of her physiological distress: the forced suppression of her emotions. When asked if she cries, Heidi admits, "Miss Rottenmeier told me I'm not allowed to cry," forcing her to "swallow" her sorrow. The doctor recognizes that her illness is not physical in the traditional sense, but a manifestation of deep-seated homesickness and psychological trauma caused by the repressive environment of the Sesemann house.
The doctor’s diagnosis is definitive: "The child is homesick." He explains to Mr. Sesemann that no medicine can cure her; the only remedy is to return her to the "mountain air" immediately. Although Mr. Sesemann is initially hesitant, worried about the social implications and the health of the child, the doctor remains firm. He warns that waiting to "fix the girl with medicine" is futile and potentially dangerous. The doctor’s advocacy for Heidi's well-being serves as the turning point of the narrative. By the end of the chapter, Mr. Sesemann accepts the reality of the situation, acknowledging that "there is only one choice." The decision is made: Heidi will return to her grandfather, marking the end of her painful exile in Frankfurt and the restoration of her hope.