Cook, stirring frequently, until the onions begin to soften, about 4-5 minutes. Add the garlic and cook for an additional minute, stirring constantly. Add the flour, thyme, salt and pepper and cook, stirring constantly, for 2 minutes.
Slowly pour the chicken broth into the pan, whisking constantly to avoid clumps. Add the heavy cream and bring to a low simmer, stirring occasionally, until the sauce thickens. Remove from heat and set aside until needed.
Tightly cover the dish with aluminum foil, then bake in the oven for 45 minutes. Remove the foil and bake for an additional 30-45 minutes, or until the sauce is bubbly and the potatoes are tender.