Useless effort. Thankless effort. Imagine running through the woods trying to catch a wild goose, even if you caught it would it be worth the time and trouble. (Compare to For naught.)
“Looking for our missing cat was a wild goose chase because she was sleeping in the closet.”