Preheat your oven to 375°F (190°C) and grease a 9×13-inch baking dish.
In a large skillet, heat the olive oil over medium heat. Add the sliced onion and cook for 8-10 minutes, stirring occasionally, until the onion is caramelized and golden brown.
In a large bowl, combine the sour cream, heavy cream, French onion soup, salt, and pepper. Mix until well combined.
Add the caramelized onions and chopped thyme to the cream mixture, stirring to incorporate.
Layer the thinly sliced potatoes in the prepared baking dish, spreading them out evenly. Pour the cream and onion mixture over the potatoes, ensuring all the layers are covered.
Sprinkle the shredded mozzarella and Parmesan cheeses evenly over the top of the potatoes.
Cover the baking dish with foil and bake for 45 minutes. After 45 minutes, remove the foil and bake for an additional 15-20 minutes, or until the potatoes are tender and the top is golden and bubbly.
In the last 10 minutes of baking, sprinkle the French fried onions on top of the potatoes and bake uncovered until the onions are crispy.
Remove from the oven and let the dish rest for 5-10 minutes before serving.