Sleepless nights, set-tos and screwed-up paper retrieved from the bin – all the stuff great architecture is made of. Right?

For anyone with the slightest suspicion of the insidious, futile processes at work behind the glossy facades of the world's so-called 'starchitects', a new documentary by Spanish architect Angel Borrego Cubero makes for compulsive viewing.

The Competition, which has its UK premiere at the Barbican tonight, follows the trials and tribulations of five stellar practices competing in a doomed bid to build a new national museum for Andorra, back in 2009. As the global financial crisis hit rock-bottom, no job was too small for architects whose dreams of dotting Middle Eastern deserts with their snazzy signatures had been revealed as a hopeless mirage. A museum the size of a department store, for a tiny microstate nestled in the folds of the Pyrenees, was not something to be sniffed at.

With an application form open to anyone who had won the Pritzker Prize, “or similar qualifications”, the callout attracted the likes of Norman Foster and Zaha Hadid, Frank Gehry and Jean Nouvel – as well as the Pritzkerless but plucky Dominique Perrault.

The documentary, to which the architects agreed as part of the entry requirements, charts the surreal process by which “iconic” projects are conjured, over a matter of weeks, by bleary-eyed interns, in a mysteriously haphazard manner.

It is a routine, familiar to anyone who has worked on competitions of this kind, that jumps and jolts between utterly different proposals: one minute the answer is a ground-scraper; the next it is a willowy tree. We see Gehry's assistants diligently screwing up scraps of paper and piling them into crumpled totem poles. Perrault's staff, stuck for inspiration, turn their model upside down, and hey presto, it makes sense! Nouvel's team start sketching a gaping yonic gash through the centre of their building: “In section, when it looks like something sexual, we are close,” quips the designer.

World-weary … Frank Gehry inspects a range of models before his presentation to the jury. Photograph: The Competition Photograph: The Competition

There is an air of desperation throughout, as the competing teams grasp blindly for novelty forms, trying to second-guess the desires of a client they have never met, in a context they have never seen, for imaginary future users they will never know. The entire process is exposed as an absurdist endeavour, fatuous shapes dressed up with just enough detail to be convincing for the jury presentation, seductive images geared towards massaging the vanity of a culture minister.

The architects' offices are revealed as factories constructed for maximum inefficiency, where untold hours are spent churning out multiple options, only for the maestro to arrive at the last minute and overturn the tables. There are late-night pizzas and despondent cigarette breaks, as teams await the arrival of their prima donna principals, who swoop in to damn the product of their labours.

“Fuck, make some holes!” screams Nouvel, inspecting an elevation of tiny windows, packed in a grid across the building's facade. “You prefer big holes?” asks the project leader. “No, I don't prefer big holes!” he snaps back. “I prefer normal holes!” before drifting out of the room, his role as the pantomime villain firmly established.

Pantomime villain … Jean Nouvel makes his frustrations known. Photograph: The Competition Photograph: The Competition

Gehry is shown to be world-weary and resigned, bumbling around his workshop between tables piled high with mindless heaps of junk. A lifetime as a purveyor of crumpled metal forms to aspirational second-tier cities has clearly taken its toll. “I don't know,” he sighs, in front of a lumpen black tower that has the look of a fossilised turd. “It's a crazy idea maybe.”

Hadid is notable by her absence – her expert PR man no doubt knowing all too well how the film would pan out – while Foster is vindicated as the one architect with the sense to drop out of the race, before his practice wasted precious resources on an elaborate charade that would ultimately come to nothing.

“Any competition is as good as the way that it's run,” he says in a fleeting cameo, speaking from an armchair with the measured tones of an all-knowing psychiatrist. “It can only be as good as the people who are organising it, writing the brief, selecting the people who will judge it, and the process of judging it. And their standards vary. Sometimes they're fantastic, sometimes they're, shall we say, a little suspect.”

Try to visit the National Museum of Andorra, and you'll realise which it was to be.

• In a similar vein, watch four star architects compete to design the 425 Park Avenue tower in New York