Place the cubed potatoes in a pot of salted water and bring to a boil. Cook for 15 to 18 minutes until fork-tender. Drain well and mash until smooth with the butter and shredded cheddar cheese. Season with salt and pepper. Set the filling aside to cool slightly.
In a large bowl, whisk together the gluten free flour, tapioca starch, xanthan gum, and salt. In a smaller bowl, whisk together the egg, sour cream, and melted butter.Pour the wet ingredients into the dry and stir until a soft dough forms. Knead gently a few times in the bowl until it holds together. If the dough is too sticky, add a little more tapioca starch.
Roll the dough out on a well-floured surface to about 1/8-inch thickness. Cut out rounds using a 3-inch round cutter. Place about 1 tablespoon of the potato filling in the center of each round, fold the dough over to form a half-moon shape, and press the edges firmly with a fork to seal.
Bring a large pot of salted water to a gentle boil. Working in batches, carefully drop the pierogi into the water and cook for 3 to 4 minutes. They will float to the top when they are done. Remove them with a slotted spoon and place them on a lightly oiled sheet.
Melt 3 tablespoons of butter in a large skillet over medium heat. Add the sliced onion and cook for 8 to 10 minutes, stirring occasionally, until deeply golden and caramelized.
Push the onions to one side and add the boiled pierogi to the skillet in a single layer. Cook for 2 to 3 minutes per side until golden and crispy on the outside.
Serve the pierogi topped with the caramelized onions, a dollop of sour cream, and a sprinkle of fresh chives.