Full Plot Breakdown & Climax: SpongeBob’s refusal to ride the "Twisting Totem" roller coaster stems from his fear of heights. When Mr. Krabs mocks him, SpongeBob summons the Flying Dutchman. However, the Dutchman has an ulterior motive: he requires the soul of the most innocent creature in the sea to shatter his ancient curse.
The Dutchman tricks SpongeBob into leading him to the ocean's deepest abyss. Upon reaching the Underworld, the Dutchman uses the mystical Hornpipe MacGuffin to extract SpongeBob's innocent soul. The resulting ritual triggers a chaotic body/ghost swap, turning SpongeBob and Mr. Krabs into glowing green spectral phantoms and slinging them into the real world onto Santa Monica beach.
The Ending: In the real world, the Flying Dutchman attempts to finalize his human transformation on land. SpongeBob, Mr. Krabs, and Patrick—riding a gigantic 3-headed seagull—chase the Dutchman onto a real-life beachside roller coaster (a land replica of the Twisting Totem).
Confronting his terror of roller coasters, SpongeBob rides the coaster to reach the Dutchman. Realizing that his bubble-blowing innocence is his true strength, SpongeBob uses his bubble wand to grab the Flying Dutchman’s cursed hornpipe and shatters it before sundown. The destruction of the horn reverses the spell, sending the Flying Dutchman back to the underworld, restoring SpongeBob and Mr. Krabs to their physical bodies, and reaffirming SpongeBob's pride in his authentic self.