Preheat the oven to 425°F.
Cut each potato into 6 wedges.
In a 9 x 13-inch metal or glass baking dish, toss the potatoes and shallots with 1 tablespoon of the olive oil and the sumac, salt, and black pepper.
Season the cavity and exterior of the chicken well with salt and pepper. Zest the lemon into a small bowl, halve the lemon and set aside.
Add the remaining 3 tablespoons olive oil to the bowl along with 4 tablespoons of the za’atar and the red pepper flakes and gently stir.
Stuff the lemon halves, garlic, and thyme sprigs inside the chicken, then rub the chicken all over with the za’atar mixture. (If you want to, you can tie the legs of the chicken together; it’s easier than doing a full chicken trussing, which is impressive but not necessary for a dish like this.) Sprinkle with the remaining tablespoon of za’atar.
Place the chicken, breast-side up, on top of the potatoes. Roast the chickenfor 15 minutes, then reduce the heat to 350°F and continue to roast the chicken until a chicken leg jiggles when pulled, the juices run clear, and the potatoes underneath the chicken are soft and the ones on the edges are crisp and golden, about another hour and 20 minutes (the rule is 23 to 25 minutes per pound of chicken, but the high roasting temperature at the beginning of the recipe shaves off a little time).
Remove the chicken from the oven and let rest for 10 minutes. Remove the lemon, garlic, and thyme springs from the cavity, discarding the garlic and thyme. Carve the chicken right on top of the potatoes, letting the juice coat the potatoes, then squeeze one or both halves of the reserved lemon on the chicken and potatoes.