1Preheat oven to 350 degrees F (175 degrees C). Butter an 8-cup casserole dish.
2Combine onion, Swiss cheese, bacon, flour, salt, and pepper in a bowl.
3Spread 1/3 of the potatoes into the bottom of the prepared casserole dish and top with 1/3 of the cheese mixture. Repeat layering twice, ending with cheese mixture. Pour heated half-and-half over top layer. Cover dish with aluminum foil.
4Bake in the preheated oven for 45 minutes. Remove foil and continue baking until potatoes are tender, 25 to 30 minutes.