Preheat your oven to 375°F (190°C). Grease a 9x13-inch baking dish with cooking spray or butter.
In a large skillet, heat the olive oil over medium heat. Add the sliced onions and cook, stirring occasionally, until they are caramelized and golden brown, about 15-20 minutes.
In a bowl, combine the beef broth, heavy cream, garlic powder, thyme, salt, and pepper. Mix well.
Layer half of the sliced potatoes in the bottom of the prepared baking dish. Pour half of the broth mixture over the potatoes, followed by half of the caramelized onions. Sprinkle half of the Gruyère and mozzarella cheeses on top.
Repeat the layers with the remaining potatoes, broth mixture, onions, and cheeses.
Cover the baking dish with aluminum foil and bake for 45 minutes.
Remove the foil and bake for an additional 15-20 minutes, or until the top is golden and bubbly.
Let the dish cool for about 10 minutes before serving. Garnish with chopped parsley.