The episode where Spongebob, Patrick, and Squidward go the the Flying Dutchman's ship and they steal his sock and they each get one wish, patrick wishes for gum, which ends up in them getting eaten, it goes back to squidward, who wishes for hair, which gets them eaten again, spongebob wishes to leave, which results in them not getting eaten.
I have only seen this episode once, and it did not air alongside any other episode, and it aired when I was in 2nd grade (2001) before the now-known one where they go through the perfume department and all that stuff
AND I AM NOT LYING!!!!! (just so you know)
An extended version of the summary (from my memory, at least) is this
The Flying Dutchman's ship appears above Spongebob's house, and Patrick and Squidward go with him to check it out, the Flying Dutchman comes out and greets them, and then imprisons them, Spongebob and Patrick find out that he is going to eat them later on, so they sneak into his room and take his sock, they are on the deck and spongebob threatens to get rid of the sock, but he will give it back in exchange for 3 wishes, everyone gets one. Patrick goes first, he wishes for mint gum, which results in them getting eaten. It goes back to before he wished for it, and Squidward wishes for hair, and the same thing happens. So spongebob wishes to go home, and they appear in his house.
if you don't believe me, then fine, but i no what i saw and it was this, and the summary may be a bit off, only because i saw it about 8, maybe 9 years ago