These cast-iron melts are comfort food at its finest.
Heat 2 tablespoons of the oil in a medium skillet over medium. Add onion and ½ teaspoon of the salt. Cook, stirring often, until golden brown and soft, about 20 minutes. Set aside.
Meanwhile, divide ground beef into 4 portions. Press each into a flat, ¼-inch-thick patty. Sprinkle with pepper and remaining 1 teaspoon salt.
Heat remaining 2 tablespoons oil in a large cast-iron skillet over medium-high. Cook 2 patties at a time, pressing gently, until browned but still pink in the center, 2 minutes per side. Transfer to a plate.
Stir together mayonnaise, mustard, barbecue sauce, and ketchup in a small bowl until combined.
Wipe out cast-iron skillet; reduce heat to medium. Divide Cheddar among 4 of the bread slices; top each with a patty, caramelized onions, Swiss cheese slice, mayonnaise mixture, and remaining bread. Melt 2 tablespoons of the butter in skillet. Place 2 sandwiches in hot butter; cook (with another skillet on top of sandwiches to weigh them down) until golden brown and cheeses are melted, about 3 minutes per side. Repeat with remaining 2 tablespoons butter and 2 sandwiches.