In a large skillet or Dutch oven, melt the butter over medium-low heat. Add the sliced onions, cover, and cook for 10 minutes until they soften, stirring occasionally.
Uncover the skillet. Stir in the beef bouillon paste, Worcestershire sauce, and thyme leaves. Season lightly with salt and pepper.
Increase the heat to medium. Continue to cook, stirring every 5-10 minutes, for 35-40 minutes. The onions will slowly caramelize, becoming deep brown and jammy.
Toward the end of the cooking time for the onions, set an oven rack about 6 inches from the heat source and preheat the broiler. Arrange the phyllo shells on a baking sheet.
Taste the onion mixture and adjust seasoning if needed. Spoon about a teaspoon of the mixture into each phyllo shell.
Top each filled shell with a generous pinch of shredded Gruyère cheese.
Place the baking sheet under the broiler. Broil for 2 to 4 minutes, watching constantly. Remove when the cheese is melted, bubbly, and has browned spots.
Let the cups cool on the baking sheet for a few minutes before transferring to a platter. Garnish with a few fresh thyme leaves before serving.