Preheat the oven to 400°F.
First, peel the potatoes, wash them, and cut them into thin slices. Wash the zucchini as well, remove the ends, and also cut them into slices. Peel the onion and chop it into cubes.
In a pot, bring the milk, heavy cream, and onion cubes to a boil. Add salt, pepper, and nutmeg, and let the mixture simmer for about 10 minutes over low heat.
Peel the garlic. Rub garlic around the casserole dish and grease it with butter.
Mix the potato and zucchini slices and spread them evenly in the casserole dish. Pour the cream and milk mixture over it.
Cover the top layer with the shredded cheese. Bake the casserole for about 45 minutes on the middle rack until golden brown.