I get what you are saying and I see the emphasis in the title of the post on the word “BY”, but I suspect you need to read the question as what NET work is done by the gas. Sure, maybe they could have specified explicitly, but that is not an unreasonable way to ask the question particularly when they say “in the cycle”. That is going to mean “net” (i.e. all the way around the cycle) every time.