Preheat your oven to 350°F (175°C).
In a large skillet, melt the butter over medium heat. Add the finely chopped onion and minced garlic, sautéing until softened and fragrant, about 3-4 minutes.
Stir in the flour and cook for about 1 minute to form a roux. Slowly add the milk and sour cream, whisking until the sauce thickens, about 3-4 minutes.
Once the sauce has thickened, stir in the grated cheese, allowing it to melt smoothly into the sauce.
Add the cooked chicken, pasta, red pepper flakes, salt, and black pepper to the sauce, tossing everything together until evenly coated.
Transfer the mixture to a prepared 9x13-inch baking dish. Sprinkle the reserved 1/2 cup of cheese on top.
Bake in the preheated oven for 20-30 minutes or until the cheese on top is bubbling and golden brown.
Remove from the oven and let it cool for a few minutes before serving.