Fish-out-of-water stories are a hardy genre, but a filmmaker trying to give a quirky twist to one has to do the job skillfully. Bill Forsythe managed the trick brilliantly with “Local Hero” in 1983, but Tom Tykwer, a director never known for his conventionality, stumbles in attempting a similar feat with “A Hologram for the King.” The presence of the naturally ingratiating Tom Hanks (who worked with Tykwer on “Cloud Atlas”) in the lead certainly bodes well. But while Forsythe, a director adept at pulling emotional strings, lured the audience into his whimsical world through genial charm, Tykwer, a far more cerebral sort, is likely to keep them at arm’s length with the sheer strangeness of his treatment. Instead of being engaging, “Hologram,” while attractive to look at, winds up feeling bizarre, surreal and oddly off-putting. It’s unlikely to replicate the approbation that David Eggers’ source novel received four years ago.

The narrative centers on Alan Clay (Hanks), an aging salesman for a high-tech Boston company who’s assigned to go to Jedda, Saudi Arabia, and clinch a deal to provide a holographic communications system for a “city of the future” that’s slowly—very slowly—emerging in the desert. Clay’s life, as we learn in a dreamlike prologue set to the Talking Heads’ “Once in a Lifetime,” has imploded. Financially he’s on his last legs, having lost his house; he can’t even cover college tuition for his understanding daughter (Tracey Fairaway). His wife (Jane Perry) has left him and is unapologetic in her criticism. And he’s haunted by his role in turning an iconic American company (Schwinn) over to a conglomerate and sending many of its jobs abroad—a fact that his father (Tom Skerritt) never tires of upbraiding him with.

So the Jedda assignment is something of a last professional chance. Unfortunately, the circumstances prove unpropitious. Clay and his team are housed not in the sleek new office building that’s risen in the middle of nowhere, but in a huge tent a good walk from it—a place with no air conditioning and irregular wi-fi service, which threatens the company’s whole demonstration (which will involve, as it turns out, a cameo by a holographic Ben Whishaw). When Clay goes to the nearby building for help, he just gets a runaround until he violates instructions and winds up on an upper floor, where he meets an agreeable Danish contractor (Sidse Babett Knudsen), who commiserates, presents him with a bottle of whiskey though alcohol is forbidden in Saudi Arabia, and ultimately will make a pass at Alan.

And that’s only the start of Clay’s problems. The king’s expected visit for the company’s presentation is constantly being delayed. The monarch’s smooth underlings are friendly but ultimately don’t deliver on their promises. Alan repeatedly oversleeps, leading him to miss the bus out to the so-called Metropolis of Industry and Trade and to hire a driver named Yousef (Alexander Black), a semi-westernized fellow with a curious sense of humor with whom Alan bonds. And then there’s the enormous cyst growing on Clay’s back, which he attempts to deal with himself—an unwise decision that lands him in the care of Zahra (Sarita Choudhury), a doctor who’s struggling against the Saudi strictures against female independence. Naturally he’ll be attracted to her, and she to him, despite all the cultural obstacles.

Tykwer’s film has a rambling, episodic quality (a trip through Mecca to Yousef’s homestead comes across as a particularly off-the-wall digression) that the filmmaker probably intended to accentuate the chasm the protagonist has to face in dealing with so alien a locale. If so, he’s succeeded only too well; the viewer is likely to feel as much at sea as Clay is, and just about as frustrated, watching him jump through what seems an endless series of random hoops.

Still, Alexander Berner’s editing is more effective in smoothing over the rough transitions than one might have expected, and the result, shot for the most part in Morocco though filming also occurred in Saudi Arabia, is also visually quite striking, with cinematographer Frank Griebe’s widescreen images boasting a bright, luminous quality. In addition, the score, which mixes bits of Vivaldi’s “Four Seasons” with modernist riffs by Tykwer and Johnny Klimek, breaks the usual mold.

Overall, though, the film is stiff, sometimes didactic and elsewhere kind of goofy while never melding the jarringly different tones into a cohesive whole. The happy ending, moreover, feels more predetermined than earned; even Hanks’ affability can’t make it entirely credible. And while Black is genially odd (in a John C. Reilly sort of way) and Choudhury is beautifully composed, neither is able to flesh out a character that’s basically sketchy.

Other recent films like “Our Brand Is Crisis” and “Whiskey Tango Foxtrot” also mined the fish-out-of-water template with mixed results. As flawed as they were, however, even they were more emotionally winning than Twyker’s coolly artificial, oddly dispassionate effort, which impresses with its surface elegance but ultimately seems as arid as the desert locale and as divorced from reality as the digital representation of the title.