Heat oven to 400º F. Coat a 3 1/2-quart casserole with cooking spray. In a medium bowl, whisk together the eggs, buttermilk, thyme, salt, and pepper; set aside. Arrange a layer of slightly overlapping potatoes in the casserole. Cover with a layer of apples and sprinkle with a third of each cheese. Pour a third of the egg mixture on top. Make 2 more layers. (Can be made up to 6 hours ahead.) Bake, covered, 1 hour, 15 minutes. Remove cover and bake another 15 minutes or until the potatoes are tender. Remove from oven. Serve warm or at room temperature.
Note: Assemble 3 casseroles to serve 30. Put one in the oven every 45 minutes so there is always a fresh gratin on the buffet.