Prepare 9x13-in. baking dish with liberal coating of butter.
In hot skillet, sauté onions in olive oil until slightly caramelized. Reserve.
Cover bottom of prepared baking dish with potato slices, slightly overlapping each slice. Season with salt and white pepper. Sprinkle with small portions of reserved onion, Gruyère, duck confit and just enough chicken stock and cream to cover layer. (Roughly 1⁄3 of each liquid per layer until all liquid is used.) Repeat layering, finishing with cheese and onion on top of casserole.
Cover baking dish with aluminum foil; bake at 325°F until potatoes are tender, 11⁄2 to 2 hours. (To check doneness, insert paring knife into center. There should be no resistance.)
Remove foil. Finish at 400°F until bubbling golden brown, about 4 minutes.
Trim excess skin and fat from duck legs. Sprinkle with salt. Massage garlic, bay leaves, thyme and pepper into duck pieces. Cover with plastic wrap; refrigerate for 24 hours.
In heavy saucepan over high heat, sear duck, caramelizing skin to a light golden brown. Blot duck pieces dry with paper towels, removing excess salt.
Pour duck fat or lard into baking pan just large enough to hold duck pieces; add duck, so all are submerged in fat. Loosely cover pan. Bake at 300°F until falling-off-the-bone tender, about 2 hours.
Lift duck from fat using tongs; set aside to cool. When duck has cooled to touch, separate meat from bone and fat, reserving meat.