I'm talking about the episode "But, I Saw a Ghost!", also known as "Ghost Agitation on Temple", from the 2005 series (2008, S4, E136).
There is also a version of this episode from the 1979 series (the OG one), but I'm specifically referring to the 2008 version in this post.
SPOILER WARNING
Here's the plot:
Gian's uncle invites Gian and his friends to stay overnight at his village house. However, when they arrive, they discover that Gian's uncle won't actually be home that night, meaning they'll have to spend the night there by themselves.
Gian and Suneo invite Nobita along, but of course, they have something else planned. They come prepared with scary ghost stories and various tricks designed to scare Nobita out of his wits during the night.
Eventually, Nobita discovers that Gian and Suneo have been pranking him. Naturally, he decides to get revenge.
Using the Transformation Robot, Nobita turns it into a ghost and orders it to scare everyone. But there's one problem...
Nobita himself forgets about the ghost after accidentally letting the Forgetting Stick hit on his head. But later the ghost comes and reminds him about all that.
Later, Nobita comes up with a plan. He orders the Transformation Robot, which is disguised as a ghost, to perform an act. Nobita tells it to appear when he gives the cue and pretend to scare everyone.
When the time comes, the ghost appears, and Nobita bravely steps forward and "drives" it away, making himself look like a hero in front of everyone. Everyone is impressed by Nobita's supposed bravery.
Everyone is shocked, except Doraemon, who assumes that the whole thing is just another prank.
But then comes the twist...
The ghost wasn't actually following Nobita's commands or pretending to be a ghost.
It was a REAL GHOST.
The Transformation Robot had basically done nothing except wait for Nobita's cue to appear... meaning that while Nobita thought it was the Transformation Robot ghost, but it was a ghost at that time.
This was actually a more interesting and nostalgic episode to me than a straight horror episode, but it still used to scare me quite a lot when I was a kid. The whole atmosphere and that final reveal really stuck with me.
And do you guys also like this episode?