A few minutes into Terry Gilliam's new film Tideland, a nine-year-old girl cooks some heroin for her dad, who is sitting expectantly in an armchair. "Daddy's going on a vacation," he explains, hunting a vein for the needle. As he blisses out, his daughter helpfully takes the lighted cigarette from his hands and stubs it out in the ashtray. Gilliam likes this scene so much that he repeats it as if to underscore how much daddy is addicted to figurative vacations and how his daughter's domestic chores will never be over until daddy ODs.

The heroin cooking is one of the many scenes that have upset viewers. Typical was Gilliam's old Monty Python chum Michael Palin. "He saw it, and I don't think he liked it. He walked straight out of the screening without saying anything. When I spoke to him later he said: 'I can't get it out of my head. I'm still not sure whether it's the best or the worst thing you've ever done.' As a reaction, that's good enough."

For good measure, Tideland also includes a bedroom scene between a 20-year-old man with learning difficulties and a little girl; a rotting corpse that makes one relieved the film doesn't come in smell-o-vision; a harrowing train crash; the disturbing sequence in which a troubled taxidermist (played by Janet McTeer) guts and stuffs the corpse of a former lover and then lays out the mummified remains in a place of honour on the bed. There is even a talking squirrel, which for some is the most disturbing thing in the picture.

Gilliam describes the film as Alice in Wonderland meets Psycho, which is a nice line for the billboards. It's also a fair description of Tideland's dance between childhood innocence and the degrading tawdriness of adult desire. Like Lewis Carroll's novel, it features a little girl plummeting through a rabbit hole into an intensely imagined fantasy world; like Hitchcock's film, it includes footage of a bewigged parental corpse in a chair (an image that Gilliam lingers over longer than Hitchcock would have dared). But the line misses Gilliam's insistence that this is the most tender film he has ever made.

In recent years Gilliam has embarked on an infamous, abortive attempt to shoot Don Quixote and a game (but finally misguided) attempt at a bona-fide blockbuster with The Brothers Grimm. But Tideland is something completely different. It tells the story of young Jeliza-Rose, who holes up with her dad, Noah, in an abandoned Texas farmhouse. After Noah dies (heroin OD, natch), Jeliza-Rose seemingly disappears into a fantasy world in which she talks chiefly to her headless Barbie dolls, romances a disturbed adult and reports home to her dad's leathery corpse. The only light relief comes from Jeff Bridges, who plays Noah, a jaded rock'n'roller who we see at the film's outset playing a gig in LA, stoned out of his crust and wearing a leather suit as he belts out an improbable tune about Van Gogh visiting Hollywood. It's a reprise of Bridge's adorable performance as the stoner Dude in The Big Lebowski, and alone worth the price of admission. "I love Jeff," says Gilliam. "I wanted him for Twelve Monkeys, but the studios wouldn't touch him. I had to have Bruce Willis instead."

If those last two paragraphs were a pitch for Hollywood money, Tideland would surely have remained a twinkle in the 65-year-old film-maker's eye. Instead, it has been completed on time within a £12m budget (quite big for an independent film) raised largely by Jeremy Thomas, a veteran producer of left-field, even engagingly tonto, cinema. How on earth did Gilliam get money for this project, particularly given that his last but one project (The Man Who Killed Don Quixote) so far has only had one cinematic result - a documentary about how the filming went, in cinematic parlance, catastrophically tits up? And, furthermore, that the Minnesotan has such a wild reputation that Warner Bros nixed him as JK Rowling's first choice to direct Harry Potter in 2000?

"Good question," he laughs as we sit in his Notting Hill production office. Gilliam, with all due respect, looks a wreck. There are blood stains on his shirt, one of his feet is bandaged and his writing hand is still strapped up following a gardening accident in which he cut through a tendon while changing a lawnmower blade. "Look at me, I'm a disaster!" If you were a producer you would give Gilliam not money for a film, but the price of a cup of tea.

"Jeremy knew it would be difficult, particularly because the film is very, very weird. But he believed in it - it's about a girl in trouble and that's a universal theme that we can all identify with." Reviewers of the novel on which the film is based compared its heroine to Harper Lee's Scout or Carson McCuller's Frankie. Several found traces of William Faulkner's eccentrically peopled southern fictions. Nobody so far has found book or film cute.

Gilliam decided to make the film after finding Mitch Cullin's novel lying on a pile of unread books in his office. "Mitch had sent it to me asking for a quote. I happened to pick it up and read it straight off. My quote? You wanna know? 'Fucking brilliant!' (In fact it says just this on the back of the the film tie-in edition of the novel). What did you like about it? "It portrays childhood innocence in a recognisable way. Not in a Hollywood way." So she's not crushed by the twin traumas of her parents' deaths, but is more resilient than adults might expect? "That's the point. Adults don't understand children. They think of them exclusively as things that need to be protected from everything. My 12-year-old son is now afraid to go to the shops in Highgate [London] because he's raised by TV to believe it's filled with rapists, murderers and muggers. It isn't. Hunter Thompson described America as a panicky ship. Today everywhere is a panicky ship. If Lewis Carroll and Baden Powell were around today they would be strung up."

A few years ago, when preparing The Brothers Grimm, he met a German woman who refused to let her young daughter read Grimms' Fairy Tales because they were disturbing. "But they're not disturbing," counters Gilliam. "They prepare kids for life." Similarly, he contends that in his film Jeliza-Rose's fantastical imagination helps her carry on, despite being abandoned to the fates before she turns 10. "She's constantly re-imagining and reinventing the world, which for a crusty old man like me, is a wonderful thing. You steadily lose that imaginative strength as you get older."

Gilliam is too hard on himself. He has reinvented Mitch Cullin's imagined childhood world for the screen in a manner every bit as visually compelling as Brazil, Twelve Monkeys and those few beguiling rushes from his attempt to make a movie out of Cervantes. Gilliam, incidentally, still has high hopes of returning to the Quixote project: "We're trying to get the rights back. If we do, my first call will be to Johnny Depp [who played a time traveller in the original]." Will Jean Rochefort be prevailed upon to remount Rosinante and play Quixote? "Probably not."

Until then, Tideland provides more than enough food for thought. Was it really a good idea to get a nine-year-old girl (the compelling Jodelle Ferland) to play a scene cooking heroin for her dad? Did her mom mind? "Her mother was fantastic. She understood the film. And Jodelle was cool in the scene. That said, she didn't really know what she was supposed to be making. What does heroin mean to a kid? I know I'm pushing buttons but we're careful to push them in the right way."

That scene has some unlikely admirers, Giliam adds. "So many women have come up to me because the situations are like those they remember." Are you saying that these women all cooked heroin for their fathers too? "That's not what the scene is about. It's about the relationship between father and daughter and how she takes on the burden of looking after him." That's what resonates - the too-early responsibility of a child for their slacker parents? "Now you're getting there."

The other sequence that, no doubt, will earn Gilliam his own little bit of tabloid controversy is the one in which Jeliza-Rose snogs a 20-year-old man called Dickens with the mind of a 10-year-old and they imagine she's pregnant as a result. "It's not a sexual scene, so any paedophile interpretations or Lolita interpretations are going to be wide of the mark," says Gilliam. What is it then? "What she wants is normalcy - Mrs and Mrs and baby. It's a fantasy she picked up from TV. Something her parents never gave her."

This is true. Infinitely more degraded and disturbing than Jeliza-Rose's fantasyland romance is the fate of the Janet McTeer character, a woman so traumatised by her disappointment in love that she cannot bear anyone or anything to leave ever again. As a result her home becomes a taxidermy, where every dead animal (her mother included) is rebuilt so they never leave her. Her existence, as a result, becomes a death in life.

By comparison, Jeliza-Rose, twice bereaved and living outside reality, seems positively well adjusted. Rarely has there been such an unsentimental, unflinching portrayal of a fraught childhood on screen. "The one thing about children you never really get is that even though they're innocent, they're selfish," says Gilliam. "Resilient and selfish. Resilient because selfish. The little buggers!" Indeed, the film's ending is a marvellous portrait of childish unconcern about proximate human tragedy. It is, then, not a Saturday night no-brainer. "Nah, I can't do those." For which, Mr Gilliam, much thanks.

· Tideland is released on August 11