Is this an error -- since insects have six legs, not four, and since "fowl" have two legs, not four? The reference to "fowl" is thought by some skeptics to refer to
birds, but the word used here is 'owph, which merely means a creature with wings -- it is the same word used in verse 21 (flying). The reference in both cases is to insects. But there is an even better - and more correct - answer.
Quite simply, the big back legs on the locust, etc. were not counted as "legs" in the same sense as the other legs. Let's use an illustration from our popular literature, George Orwell's Animal Farm. In this story, Snowball the pig invented the slogan, "Four legs good, two legs bad" so as to exclude humans from Animal Farm society. The geese and other fowl objected, because they had only two legs. Snowball explained (more clearly in the book than in the movie) that in animal terms, the birds' wings counted as legs because they were limbs of propulsion, not manipulation, as a human's arms and hands were.
Now note the differentiation in Leviticus above -- referring to "legs above the feet" for leaping. The "feet" are being differentiated from the "legs above the feet" because of their difference in function. They are legs, but in a different sense than the "four" legs which are just called "feet." We are being told of two types of legs: The "on all four" legs (which are nowhere called legs; they are only called "feet" [v. 23]), and the "leaping legs." It is clear that the Hebrews regarded the two large, hopping hind limbs of the locust and the other insects of the same type, which are the only types of insects mentioned here (we now translate "beetle" as "cricket"), as something different than the other four limbs - perhaps because they were used primarily for vertical propulsion, whereas the other limbs were for scurrying around. (Shifts of terminology like this happen even today; check this proposal to redefine "planet".)