Preheat your oven to 400 degrees. Spray an 8X8 baking dish with non-stick cooking spray and set aside.
In a large non-stick skillet melt 2 tbsp butter over medium-hight heat. Once melted, add the onions. Let the onions cook four about two minutes. Next, add in the granulated sugar, Worcestershire, thyme, salt and pepper. Stir and continue to cook for a few minutes.
Pour in the beef broth into the skillet and start scraping the bottom of the skillet making sure everything is well combined and turn the heat to simmer.
Stir the oninos to keep them from burning at the bottom of the skillet until golden brown; about 20 minutes. Once cooked, set aside.
While the onions cook, bring a large pot full of water to a boil. Add the gnocchi and cook according to package instructions. Once the gnocchi has cooked, drain through a colander and add the cooked gnocchi to the prepared baking dish.
In a medium saucepan, melt the remaining 3 tbsp of butter over medium heat. Add in flour and whisk until a roux forms; about a minute. Pour in the milk and whisk until thickened about five minutes. Add in the salt and pepper to taste.
To assemble the casserole, evenly place the onions over the gnocchi. Next, pour the white sauce over the onions followed by the mozzarella. Bake for about 10 to 15 minutes or until cheese has turned golden brown. Garnish with fresh thyme.