Preheat oven to 375°F. Grease a 9x13 dish; spread half the tots evenly.
Sauté onion in butter and oil over medium about 5 minutes, until soft. Add mushrooms and thyme; cook about 7 minutes, until released liquid evaporates. Season with salt and pepper.
Spread mushrooms over tots; sprinkle with 1 cup gruyere. Top with remaining tots and 1/2 cup gruyere.
Whisk eggs and milk; pour evenly over casserole. Press gently so liquid reaches tots.
Bake uncovered 35–40 minutes until set and golden. Rest 10 minutes before serving.