Spray a 10x10-inch baking dish with oil and set aside.
Add olive oil to a saucepan over medium-low heat, or use the inner pot of an Instant Pot set to Sauté on Low for 10 minutes.
When the oil is hot, add red onion and sauté until softened.
Stir in heavy cream, milk, garlic powder, onion powder, and fresh thyme, whisking well to combine.
Once the mixture simmers, whisk in the flour and bring to a boil, continuing to whisk.
Add salt and pepper and boil for 1 more minute. Turn off the heat and set the saucepan aside, or press Cancel on the Instant Pot and remove the inner pot.
Arrange half of the sliced potatoes in the baking dish, sprinkling a pinch of salt and black pepper between layers.
Pour half of the cream sauce over the potatoes. Repeat with the remaining potatoes and sauce.
Layer Gruyere cheese slices over the potatoes and sprinkle grated Parmesan cheese on top.
Cover the bakeware with a lid or aluminum foil. Place the rack in the Omni oven at the Bake level. Select Bake, setting the temperature to 375°F / 191°C and the time to 3 minutes to preheat. Press Start.
When the oven is hot, place bakeware on the oven rack and set the time to 40 minutes, keeping the temperature and cooking function the same. Press Start.
After 30 minutes, remove the foil and bake uncovered for the remaining 10 minutes. When the timer ends, leave the potatoes in the oven for 5 minutes to rest.
Remove the dish from the oven and let it rest for another 5 minutes before serving. Enjoy!