In a large skillet, melt the butter with the olive oil over medium-low heat. Add the sliced onions, salt, and optional sugar. Cook, stirring every few minutes, for 35 to 45 minutes until the onions are deeply golden, soft, and jammy. Stir in the garlic and thyme during the final minute.
Remove from the heat and cool for about 10 minutes. Reserve half of the caramelized onions for topping the meatloaf.
While the onions cool, preheat the oven to 350°F. Line a sheet pan with parchment paper.
In a large bowl, combine the ground beef, eggs, milk, panko, Worcestershire sauce, Dijon mustard, French Seasoning, black pepper, half of the caramelized onions, and 1 cup shredded Gruyère. Mix gently with your hands until just combined. Do not overmix. Shape into a loaf about 9 x 5 inches and 2½ inches tall on the prepared baking sheet.
Bake for 45 minutes.
Remove the meatloaf from the oven and evenly spoon the rest of the caramelized onions over the top. Sprinkle with the remaining 1 cup Gruyère.
Return to the oven for 15 to 20 minutes, or until an instant-read thermometer inserted into the center registers 160°F.
Broil for 2 to 3 minutes until the cheese is melted, bubbly, and lightly golden.
Let the meatloaf rest for 10 minutes before slicing. Garnish with fresh thyme and parsley, if desired.