Preheat the oven to 375°F. In a large skillet, melt 2 tablespoons of butter over medium-low heat. Add the sliced onions and cook slowly, stirring often, until they turn deep golden brown and soft, about 25 minutes. Remove from heat and set aside.
In a large bowl, combine the ground beef, breadcrumbs, egg, Worcestershire sauce, thyme, salt, pepper, and half of the caramelized onions. Mix gently with your hands until just combined, then shape the mixture into a loaf and place it on a baking sheet.
Bake the meatloaf for 45 to 50 minutes until it reaches an internal temperature of 160°F. Let it rest for 5 minutes before slicing.
While the meatloaf rests, make the gravy. Melt the remaining tablespoon of butter in the skillet over medium heat. Stir in the flour and cook for 1 minute. Slowly whisk in the beef broth, then add the remaining caramelized onions. Simmer, stirring often, until the gravy thickens, about 5 minutes. Serve the gravy spooned over the sliced meatloaf.