Preheat your oven to 375°F (190°C).
In a skillet, heat the olive oil over medium heat. Add the sliced onions and cook, stirring occasionally, until caramelized (about 10-15 minutes). Remove half of the onions and set aside for the gravy.
In a large mixing bowl, combine the ground beef, caramelized onions, breadcrumbs, egg, salt, pepper, garlic powder, and Worcestershire sauce. Mix until everything is well combined.
Place the meat mixture into a loaf pan, pressing down to shape it. Cover with aluminum foil and bake for 40 minutes.
After 40 minutes, remove the foil, sprinkle shredded mozzarella or Gruyere cheese on top, and bake for another 10 minutes until the cheese is melted and bubbly.
In the same skillet, melt the butter over medium heat. Add the reserved onions and cook for 1-2 minutes. Sprinkle flour over the onions, stirring continuously. Gradually add the beef broth, whisking to avoid lumps. Simmer for 5 minutes until thickened, and season with salt and pepper.
Slice the meatloaf and serve topped with the onion gravy. Garnish with fresh parsley if desired.
