Surrealism is a tricky thing. There’s an incredibly fine line that an artist must walk in order to achieve an end product that combines dream-like logic with heady, symbolic imagery. Play things too “weird for weird’s sake,” and you risk alienating the audience. Play things too real, and you risk a film that’s filled with an assortment of inexplicable character changes and plot twists that are explained away with the shrug of dream-like strangeness. Asleep in the Sun, for all its ambition and beautiful imagery, walks the line but stumbles a little too much to fully achieve its goals.

The film tells the story of Lucio (Luis Machín), a loving husband and unemployed watchmaker in 1930s Argentina. His wife, Diana (Esther Goris), is suffering from something unknown. By description, it sounds like bipolar disorder, but nobody ever describes her problem in clinical terms — not even the doctors. Her growing obsession with dogs — specifically, dogs that Diana believes can talk to her — leads Lucio to reluctantly confine her to a “phrenopathic institute” run by the shadowy Dr. Reger Samaniego (Carlos Belloso).

It’s around this time that the word “Kafkaesque” comes into play. What first seems like an ordinary sanitarium starts to seem like a labyrinthine prison. Lucio starts to get a sense that Diana is trapped there, held against her will by a doctor who refuses to see him. Samaniego’s assistant, Dr. Campolongo (Héctor Díaz), talks in circles eerily reminiscent of The Trial, which confuses and frustrates Lucio. When he finally meets Samaniego, the good doctor subtly implies mental illness is a contagious disease, and that Lucio is likely infected and should voluntarily commit himself, as well. Just when Lucio is prepared to sue the institute, he receives the call that Diana will be released.

When she returns home, Diana seems subtly different. She confuses the names of family members, her cooking isn’t up to par, she grows increasingly obsessed with reading her old diaries, and — most tellingly for Lucio — she suddenly enjoys fellatio. Lucio’s fear and suspicion mounts. He returns to the hospital to confront Samaniego, and that’s when things get really weird.

Unfortunately, writer/director Alejandro Chomski makes two grave miscalculations that undermine the film’s dream-like qualities: too much foreshadowing, and too much “realism.” The film has a few echoes of Pan’s Labyrinth in its attempts to ground a fantastical story in a brutal reality, but it doesn’t pay dividends here. It simply makes Lucio’s actions in the third act seem really out of character and boneheaded. The inconsistency is pretty much chalked up to, “It’s surreal — it doesn’t have to make sense.”

However, it’s stuck in the center of a precarious plot that’s not surreal enough to betray the characters’ previous behavior, yet isn’t grounded enough in believability to be accepted as some sort of convoluted science-fiction. Numerous twists pile up in the last 20 minutes, but they’re too predictable (because of all the foreshadowing) and/or too inconceivable to make the film satisfying as a whole. The end result is a bit of a disappointing mess.

Despite the big problems with the third act, the film is loaded with elements worth admiring. It boasts great performances all around, anchored by Machín, whose doleful eyes create palpable despair that make him easy to root for even when he’s acting like an inexplicable idiot. Chomski and cinematographer Sol Lopatin create gorgeous images that make the film easy on the eyes even when it’s hard on the logic centers. Several early dialogue scenes impressively evoke the absurd, circular illogic of Franz Kafka and Albert Camus. Lots to admire, but ultimately it doesn’t hold together.