Melt butter in a saucepan over medium-low heat. Let simmer for 1 minute. Add flour, 1 tablespoon at a time, whisking constantly until completely incorporated, 5 to 8 minutes. Add 1 cup water slowly and whisking constantly to avoid clumping. Remove from heat.
Whisk remaining 2/3 cup water together with cornstarch in a small bowl. Add slurry to the gravy; whisk to combine.
Preheat the oven to 375 degrees F (190 degrees C).
Stir the gravy briefly; season with salt and pepper. Add thyme and rosemary. Stir in Swiss cheese and Gruyere cheese. Add potatoes, scallions, and garlic; stir well until potato slices are separated and coated with gravy. Pour mixture into an 8-inch square baking dish.
Bake in the preheated oven until potatoes are tender, 40 to 50 minutes.