Adjust oven rack to middle position of 400 degree oven.
Combine the Comte and Parmesan cheeses, set aside 1/3 of the cheese mixture. In a separate larger bowl, mix together the cream, garlic, shallots, and thyme. Peel and slice the potatoes into ⅛ inch slices, adding directly to the cream mixture as you work. This will keep them from oxidising. Add 2/3rds of the cheese mixture and mix well to make sure potatoes are not sticking together and are all coated.
Butter the bottom of the square baker. Start lining the outside of the dish with potatoes vertically around the rim and continue around until you get to the center. Once the baker is completely loaded with potatoes and cheesy cream, cover with aluminum foil.
Place in oven and bake for 35-40 minutes.
Remove the gratin from the oven and discard the foil. Sprinkle the remaining cheese over the top of potatoes and return to the oven. Bake another 20 minutes until golden brown and crispy.
Allow the gratin to cool a bit. Garnish with Maldon sea salt and serve.