Melt the butter and then add sliced onions and pinch of sugar. Stir to coat. Continue to let the onions cook until caramelized.
Heat oven to 425 degrees. Toss sweet potato cubes with olive oil and salt and pepper. Roast until soft, about 20 minutes.
Cut the bratwurst lengthwise and remove the ground bratwurst from the casing. Cook the bratwurst until no longer pink. As the brat cooks, break up with a spoon to crumble.
Layer half of the cooked spaetzle and top with half of the cheeses. Spread half of the bratwurst crumbles, roasted sweet potato cubes and caramelized onions on top. Repeat and bake.