I wish you would learn to say idiomatic expression rather than "fixed"--no one, in the American language would say "fixed phrase," or "fixed expression"--any native speaker of the American language would say or at least understand idiomatic expression. I rather suspect that the same applies to those who speak British English and its variants.
"Foiled again" became an idiomatic expression because it was used so often in cheap fiction of the late 19th and early 20th centuries. It was parodied so often that it became a commonplace to depict villains of the late 19th centuries as saying "Curses, foiled again." when their plans were undone by the hero.
In the 1960s, a popular cartoon program included a weekly segment on "Dudley Do-right" of the "Mounties" (refers to the Royal Canadian Mounted Police, which is historical anachronism for reasons i will not go into here). His perennial enemy was "Snidely Whiplash," pictured below, who would frequently exclaim: "Curses, foiled again," as the Mountie would save Nell Fenwick, the beautiful young heroine, in each episode.
The image of Snidely Whiplash, and his stock behavior of tying Nell to the railroad tracks as a train approached, necessitating a last minute rescue by Dudley Do-right, were all classic images which parodied the cheap pulp fiction of the late 19th century. I couldn't say if there ever actually was a fictional villain who said: "Curses, foiled again," but i suspect it was a stock line used in cheap, local theater productions in the 1890s or the early 1900s.