Preheat oven to 375°F (190°C) and grease a 9x13 inch baking dish.
Brown ground beef and onion in a skillet over medium-high heat until meat is no longer pink; drain fat.
Stir garlic, 1/2 tsp salt, and 1/4 tsp pepper into the beef mixture.
Melt butter in a saucepan over medium heat; whisk in flour and cook for 1 minute.
Slowly whisk in milk and cook until thickened; remove from heat and stir in 1.5 cups cheese, remaining salt, pepper, and thyme.
Layer half of the potatoes in the baking dish, followed by the beef mixture and the remaining potatoes.
Pour cheese sauce over the top layer and cover dish with aluminum foil.
Bake for 45 minutes, then remove foil.
Sprinkle with remaining cheese and paprika, then bake for 15 minutes until potatoes are tender.
Rest for 10 minutes before serving.