I don’t quite get your point about Dahl. I read Charlie and the Chocolate Factory as a kid — it was not too much different from the Gene Wilder version or so I thought. The Johnny Depp version was creepy.
Maybe you’re referring to another of his stories.
Tales of the Unexpected?
James and the Giant Peach?
You Only Live Twice (the movie script not the book)?