Nicole's French Onion Mac and Cheese

6 tablespoons butter, divided
1 tablespoon olive oil
2 large sweet onions, thinly sliced
2 teaspoons fresh thyme leaves
2 teaspoons Worcestershire sauce
1 tablespoon dry sherry
1 tablespoon kosher salt, divided
1 teaspoon ground black pepper, divided
1 (12 ounce) package elbow macaroni
¼ cup all-purpose flour
2½ cups whole milk
2 cups shredded white Cheddar cheese, divided
2 cups shredded Swiss cheese, divided
¼ French baguette, cut into 1/2-inch slices

Heat 2 tablespoons butter and olive oil in a large skillet over medium heat. Add onions and cook, stirring constantly, for 1 minute. Reduce heat to medium-low and cook, stirring occasionally, until golden brown, about 40 minutes.
Add thyme, Worcestershire, and sherry and cook until most of the liquid has evaporated, about 3 minutes. Season with 1/2 teaspoon salt and 1/2 teaspoon pepper. Remove onions from the pan and set aside. Reserve skillet.
Bring a large pot of water to a boil and add 2 teaspoons salt. Add pasta and cook until tender, about 6 minutes. Drain and set aside.
Preheat the oven to 375 degrees F (190 degrees C). Butter a 9x13-inch or 3-quart baking dish.
Place the reserved skillet over medium heat and add remaining butter. When butter has melted, whisk in flour and cook, stirring often, 2 minutes. Whisk in milk and bring mixture to a simmer, stirring often. Sprinkle with remaining salt and pepper and cook 5 minutes, stirring often. Stir in 1 1/2 cups Cheddar and 1 cup Swiss cheese and remove from heat.
Stir in reserved onions and pasta and pour mixture into the buttered baking dish. Tear bread slices in half and place over the top of the pasta mixture. Sprinkle with remaining cheeses.
Bake in the preheated oven until golden and bubbly, about 25 minutes.