In a covered large saucepan cook sliced potatoes in a small amount of boiling, lightly salted water about 10 minutes or just until tender. Add leeks the last 5 minutes of cooking. Drain potato mixture.
Coat a nonstick baking dish with cooking spray. Spread potato mixture in bottom of the prepared baking dish. Sprinkle with ham and Swiss cheese.
In a medium bowl, stir the milk into the flour until smooth. Stir in the egg product, thyme, and pepper. Pour the egg mixture over potato mixture.
Bake for 35 to 40 minutes or until a knife inserted near the center comes out clean.