Add 1 Tbsp butter to a large skillet over medium low heat. When melted, add onions and stir until well coated in butter.
When onions are turning transparent, after about 10 minutes of cooking, stir in brown sugar. Continue cooking for 20-40 minutes, stirring every 5 minutes or so, until onions are well caramelized. Stir in salt and pepper.
Spread remaining 2 Tbsp butter on one side of all four slices of bread. Spread a thin layer of dijon on the other side of the bread slices. Place two slices of bread bread butter-side-down on skillet over medium-low heat.
Place 2 slices cheese on each slice of bread. Top with corned beef slices and caramelized onions.
Top with the other slice of buttered bread. And after cooking a few minutes on one side, carefully flip the sandwich over. Cook until bread is toasted and cheese is melty.