Melt 2 tablespoons of the butter in a 10-inch cast-iron skillet over medium heat. Add the sliced onions and cook, stirring often, until they turn deep golden brown, about 20 minutes. Remove half the onions to a plate and set aside.
Heat the oven to 375°F. In a large bowl, combine the ground beef, panko breadcrumbs, egg, thyme, salt, pepper, and the remaining caramelized onions. Mix gently with your hands until just combined.
Shape the mixture into a loaf directly in the skillet. Spread the reserved caramelized onions over the top. Bake for 40 minutes.
Remove the skillet from the oven. Carefully transfer the meatloaf to a plate and cover it loosely with foil. Place the skillet back on the stovetop over medium heat.
Add the remaining tablespoon of butter to the skillet. Sprinkle in the flour and whisk for 1 minute. Slowly pour in the beef broth while whisking to form a gravy. Simmer for 3 to 4 minutes until it thickens.
Return the meatloaf to the skillet. Sprinkle the crispy fried onions over the top and let it rest for 5 minutes before slicing.