Preheat oven to 375 degrees
Thinly slice potatoes. Set aside.
Shred extra sharp cheddar cheese and set aside.
To a pan over medium heat melt butter and cook diced onion for 10 minutes.
Add minced garlic and cook one more minute before adding flour. Whisk the flour and cook the raw taste out for at least a minute before adding the whole milk and heavy whipping cream. Whisk the lumps out.
Add salt, pepper, fresh thyme. Whisk well then add the shredded extra sharp cheddar cheese in batches. Whisk until melted before adding more.
Dry off the potato slices if they excreted water. Toss in the cheese sauce.
Place the cheesy potatoes in a buttered 9x13 dish or pan and cover with foil.
Bake for one hour uncovered.
If making ahead of time, remove from the oven and allow to cool completely to room temperature. Cover and refrigerate. Continue with the next step when ready to serve. Remove from the refrigerator an hour before baking so the pan loses it's chill.
Remove the foil, add the shredded Gruyere and parmesan cheese. Put back in the oven on the top shelf. Bake uncovered for 20 minutes until the cheese is melted. Broil at the end until the top is golden brown.
Allow to rest for 20 minutes before serving.