Prepare the Meatballs: In a large bowl, combine the ground beef, breadcrumbs, grated Parmesan cheese, egg, minced garlic, dried thyme, salt, and black pepper. Mix until well combined. Form the mixture into small meatballs, about 1 inch in diameter.
Cook the Meatballs: Heat 2 tablespoons of olive oil in a large skillet over medium heat. Add the meatballs and cook until browned on all sides and cooked through, about 8-10 minutes. Remove the meatballs from the skillet and set aside.
Caramelize the Onions: In the same skillet, add the unsalted butter and 2 tablespoons of olive oil. Add the sliced onions and cook over medium-low heat, stirring occasionally, until the onions are golden brown and caramelized, about 25-30 minutes. Add the sugar halfway through the cooking process to help with caramelization.
Make the Sauce: Add the beef broth, dry white wine (if using), dried thyme, salt, and black pepper to the caramelized onions. Stir to combine and bring to a simmer. Cook for an additional 5 minutes to allow the flavors to meld.
Combine Meatballs and Sauce: Return the meatballs to the skillet with the onion sauce. Stir gently to coat the meatballs in the sauce. Sprinkle the shredded Gruyère or Swiss cheese over the top.
Bake: Preheat your oven to 375°F (190°C). Transfer the skillet to the preheated oven and bake for 10 minutes, or until the cheese is melted and bubbly.
Serve and Garnish: Remove the skillet from the oven and garnish with chopped fresh parsley. Serve hot.