Preheat the oven to 400 degrees F (200 degrees C).
Poke holes into potatoes using a knife. Wrap each potato in aluminum foil and place on a baking sheet.
Bake in the preheated oven until potatoes are very tender and easily pierced with a knife, about 1 hour and 15 minutes.
Let potatoes cool to room temperature. Unwrap and place on a plate. Cover with plastic wrap and refrigerate until completely chilled, 8 hours to overnight.
Preheat the oven to 425 degrees F (220 degrees C). Butter a casserole dish.
Leave skin on potatoes. Use a cheese grater to shred potatoes into a large bowl. Add shallots to potatoes; season with salt, white pepper, and cayenne. Toss with two forks until well combined.
Add Cheddar cheese and mix well. Gently toss in sour cream until barely combined.
Transfer mixture to the prepared baking dish, piling it up high, then patting it down very lightly.
Bake in the preheated oven until piping hot and the top is browned, 30 to 35 minutes.