"I want to ask you a favor" is no semantically different than "i have a favor to ask you" and thus should be accepted as a correct answer
Duolingo doesn't think in terms of "is this translation acceptable", but " Is this literal translation correct?" Maybe the developers could focus on helping Duolingo understand colloquial stuff. Or, maybe not. Perhaps someone doesn't know what "avoir" means? Then, it is in that person's benefit to consider the meaning of that word rather than just making a synonymous definition.