Begin by heating olive oil in a large skillet over medium heat. Add the thinly sliced onions and stir occasionally for about 25 to 30 minutes until they turn golden brown and soft. Add the sugar to boost caramelization, then stir in the balsamic vinegar. Let it cook for another 2–3 minutes until the vinegar is fully absorbed. Set the onions aside.
In the same skillet, brown the ground beef with a sprinkle of salt and pepper. Once cooked through, form the meat into four burger patties. Let them rest while you make the sauce so the juices redistribute.
Warm the beef broth and Worcestershire sauce in a small saucepan. In another pan, melt butter and stir in flour, cooking it for 2–3 minutes to make a light roux. Slowly add in the warm broth while whisking. Simmer the sauce until thickened, about 5 minutes, then turn off the heat.
Preheat your grill or grill pan. Grill each patty over medium-high heat for 3–4 minutes per side. In the final minute of cooking, place a slice of Gruyère cheese on top and cover to help it melt nicely.
Toast the brioche buns until golden. Place a cheesy patty on the bottom bun, add a generous spoonful of caramelized onions, and then pour a bit of the thickened sauce over the top. Sprinkle with fresh thyme leaves and cap it with the top bun.