This is a cartoon I remember seeing an episode of as a preview on a VHS tape in the early 2000s. The VHS may have been of The Wizard of Oz if that helps, but I can't be sure.
In it, the protagonist is a character with a removable jack-o'-lantern for a head (he could still talk even if it was removed from his body) and I believe he has to steal/recover gold from the antagonist who may have been a headless horseman. There was a general supernatural feel about the story's setting, and I'm sure there were other fantasy characters (a witch possibly?). It was for children though, so not anything sinister or too scary.
Just to be clear, I don't think this cartoon had anything to do with the feature film it preceded, although I was a child at the time so I may be incorrect. On the same VHS I'm sure there was also an episode of the old Pink Panther cartoons in the previews, so this cartoon I'm searching for doesn't necessarily have to be about The Wizard of Oz. To summarise some comments I've made in the question, I'm quite sure this cartoon was part of a larger series, and the animation style looked old/low budget for the early 2000s, reminiscent of the old Scooby-Doo cartoons from the 70s.