Saute onions in butter until browned and caramelized, about 30 minutes.
Preheat oven to 350F.
Rub baking dish with garlic. Place melted butter in shallow gratin or baking dish. Combine eggs, cheese, cream, salt, pepper and thyme; whisk well.
Combine the potatoes and turnip slices. Layer one third sliced vegetables, one third caramelized onions, and one third greens in prepared dish. Pour one third custard over, repeat layering vegetables, onions, greens and cream mixture.
Cover with foil and bake 1 hour or until potatoes are soft or tender when pierced with a knife. Remove foil and bake for 10 more minutes until bubbly and golden.