The Arthurian legends might seem to provide rich territory for filmmakers, but actually they have more often proven a trap. Does anybody think that Joshua Logan’s 1967 film of Lerner and Loewe’s “Camelot” is any good? Or that Antoine Fuqua’s down-and-dirty 2004 take on “King Arthur” is enjoyable? Or that the 1963 kidflick “The Sword in the Stone” isn’t one of Disney’s weakest animated efforts? Even John Boorman’s “Excalibur” (1981), usually considered the gem of the genre, is more a visually mesmerizing oddity than a fully successful reimagining, and it’s undermined by Nigel Terry’s inadequacy as Arthur.

Now Guy Ritchie steps up to the plate, only to prove that he’s not the person capable—to use Malory as metaphor—of pulling the cinematic sword from this ancient stone. That’s not terribly surprising, given what he did to poor Sherlock Holmes. But “King Arthur: Legend of the Sword” is even worse than his trashing of the Baker Street detective: it’s a dispiritingly lowbrow would-be epic—a modern-day bastardization rather than an imaginative rethinking, totally lacking in grandeur.

There is, of course, no single “canonical” telling of Arthur’s story, but rather a welter of differing, often contradictory accounts, beginning in earnest with Geoffrey of Monmouth’s twelfth-century version and extending down through medieval French romances to such modern retellings as T.H. White’s “The Once and Future King” and the recent British TV series “Merlin.” So there’s no reason that Ritchie, along with his co-writers Lionel Wigram and Joby Harold, shouldn’t have come up with a narrative of their own. The problem is that they’ve mashed together elements of the tradition with crude modernisms and the clichés of today’s CGI-laden action movies to form an unholy brew of mindless mayhem, juvenile silliness and splashy special effects.

What they’ve come up with is this. Arthur is the son of King Uther Pendragon (Eric Bana, exuding virile nobility), the ruler of Camelot. Armed with the sword Excalibur given him by Merlin, Uther defeats the latest assault on his kingdom by Mordred, who attacks with not just a horde of warriors but huge elephants manufactured by magic. Unfortunately, he is then betrayed by his brother Vortigern (Jude Law, chewing ravenously on the scenery, even of the computer-generated variety), who sacrifices his wife to a group of slithering demons inhabiting the murky waters below the castle walls in order to gain the power to defeat Uther and claim the throne. Uther tries to save his wife and child, but only the boy survives, cast adrift in a small boat, and the sword is encased in the stone formed from Uther’s corpse, which falls into the deep before Vortigern can get to it. (Much of this is revealed only in later flashbacks, in which Arthur recovers the repressed memories of the experience. Freud must be nodding in approval.)

In any event, the boy makes his way to Londinium, where he endures a terribly brutal childhood (cue a typically fast-paced Ritchie montage of him growing up to become Charlie Hunnam). He has been taken in by the ladies of a brothel, and believing that he is the son of one of the prostitutes, naturally becomes a con-man and thief, the head of a gang of thugs that comes across like a low-rent urban version of Robin Hood’s merry men and prominently includes the ever-loyal Backlack (Neil Maskell) and his little son Bleu (Bleu Landau). Arthur’s come to an arrangement with one of the king’s black-suited sergeants to protect him from arrest, but that’s upset when the waters around Camelot suddenly go bone dry and the rock with the sword embedded in it is revealed.

That sets Vortigern on a quest to find Arthur, his potential rival, by forcing all men of a certain age to try to extract the sword from the stone. When Arthur does so, Vortigern orders his public execution, but forces intrude to save him. These are the members of the resistance movement, most importantly sonorous-voiced Bedivere (Djimon Hounsou) and master archer “Goosefat” Bill (Aidan Gillan), who are advised by Guinevere (Astrid Berges-Frisbey), here a wizard standing in for Merlin; she has the power to make birds do her bidding and can conjure up a huge snake when necessary, as she will do in the big final battle.

What follows is a largely incomprehensible narrative farrago, dominated by Arthur’s gradual coming to accept his destiny as he recovers those nasty repressed memories (the techniques of psychoanalysis not yet being available, he must do so via electrical charges when he touches the hilt of Excalibur). He joins the resistance movement, which is reinforced with members of his old gang like Backlack and—rather incongruously—his old kung-fu mentor, a Chinese fellow named George (Tom Wu). The group is also aided by information passed to them by Maid Maggie (Annabelle Wallis), a traitor on Vortigern’s staff.

The scenario boils down to a series of messy action sequences, shot muddily by cinematographer John Mathieson (whose images are often further sabotaged by special-effects overlays) and edited in ADD style by James Herbert, all to the accompaniment of an irritatingly pulsating score by Daniel Pemberton, whose attempts to add some Celtic elements sound simply off-key. There’s a misguided assassination attempt on Vortigern, an extended chase through Londinium’s streets, and finally the face-off between Arthur and his nefarious uncle back at Camelot (where, for some unexplained reason, an ever-rising tower is the source of the usurper’s powers, and to raise it to completion he must now sacrifice his daughter). That’s where Guinevere’s humongous snake also comes into play. Before the culminating swordfight between a transformed Vortigern and his nephew—a sequence ruined by the addition of animated sparks and flashes—there are also deaths, scenes of torture and lots of nasty verbiage spouted by Law as though he were a preening Bond villain.

Throughout Hunnam tries valiantly (a nod to another bad Arthurian movie, “Prince Valiant”) to be charismatic, but the effort fails, hobbled especially by the supposedly cool bits of modern lingo Ritchie has ladled into the screenplay. (Ritchie also indulges in a few of his trademark scenes in which dialogue is tossed about among characters in hastily-edited little spurts.) It makes you wonder whether the actor was wise to pull out of “Fifty Shades of Gray,” presumably in order to do this (though which movie is worse, to be honest, would be difficult to decide).

In any event, it would be unfair to blame him, or any of the rest of the cast (not even Law, despite his hilarious overkill) for what is really Ritchie’s folly. For some reason (perhaps Robert Downey, Jr.), the director attracted large, happy audiences for his last exercise in wretched excess, the two “Sherlock Holmes” travesties, although both were about on the level of Barry Sonnenfeld’s notoriously awful “Wild Wild West.” One can only wonder what iconic figure Ritchie intends to demolish in a riot of action and effects next.