Make the caramelized onions: Melt the butter in a skillet over medium-low heat. Add the sliced onion, salt, and pepper and cook slowly, stirring occasionally, until the onions are soft and caramelized, about 25–30 minutes.
Assemble the sandwiches: Slice the ciabatta and spread a layer of bacon jam on the bottom half. Add the grated sharp cheddar. Add a layer of caramelized onions, followed by a layer of thinly sliced Granny Smith apple and pickled red onions.
Cook the grilled cheese: Butter the outsides of the ciabatta and add the sandwich to a skillet over medium-low heat. Cook for 3–5 minutes per side, pressing gently with a spatula, until the bread is toasted and the cheddar has melted. If the bread is browning before the cheese melts, lower the heat and cover the skillet for a minute or two. Slice and serve warm.