Preheat oven to 425 degrees F.
For the onion soup mix-in: Melt the butter in a large Dutch oven or pot over medium-low heat. Add the onions, Worcestershire, thyme, bay leaves, 1/2 teaspoon salt and a few grinds of pepper and cook, stirring frequently, until the onions are very soft and lightly golden, 15 to 20 minutes.
Add the white wine, bring to a simmer and cook, stirring, until the wine is almost completely evaporated, about 2 minutes. Add the beef broth, bring to a high simmer and cook, stirring, until almost all the broth is absorbed, 4 to 5 minutes. Season with salt and pepper. Remove the bay leaves and thyme. Transfer the onions to a medium bowl and set aside. Clean out the pot and set aside.
For the mac 'n' cheese: Grease a 9-by-13-inch baking dish with butter; set aside. Bring a large pot of salted water to a boil, add the macaroni and cook according to package instructions. Strain, reserving 1 1/2 cups of the pasta water, and toss the macaroni with the oil to keep it from sticking.
Melt 4 tablespoons of the butter in the large Dutch oven (used for the onion mixture) over medium heat. Add the flour and whisk until smooth, about 2 minutes. Gradually whisk in the milk, reserved pasta water and Worcestershire. Bring to a simmer, whisking constantly, and cook until the mixture is thicker than heavy cream, about 4 minutes. Stir in 3 cups of the Gruyere, 1 cup of the Cheddar, 1 1/2 teaspoons salt and a few grinds of pepper until melted and smooth. Remove from the heat, stir in the cooked pasta and half the onion mixture until coated and pour into the prepared baking dish.
Toss the bread, thyme and remaining 1 tablespoon of melted butter in a medium bowl until the bread is nicely coated. Spoon the remaining onion mixture on top of the mac 'n' cheese, top with the bread cubes, then sprinkle with the remaining 1/2 cup each Gruyere and Cheddar. Bake until golden brown on top and bubbly, 10 to 15 minutes. Serve hot.