For the castle piece, talk to the jester — he's the one who hands it over.
While you're collecting, two other items in that area trip people up: the rice is sitting by the bucket, and the bag is over by the toilet. Grab all three in one pass and you won't have to backtrack through the level.