Heat butter and olive oil in a skillet over medium-low heat. Add the sliced onions and season with salt and pepper.
Cook for 40-50 minutes, stirring frequently, until onions are deeply golden and jammy. During the last 10 minutes, stir in balsamic vinegar and continue cooking.
Spread mayo on one side of each slice of bread. Flip the bread over and spread Dijon on the other side.
Divide the cheddar, Gruyère, and caramelized onions between the two sandwiches. Top with the remaining bread, mayo side facing out.
Heat a skillet over medium-low heat and add avocado oil or butter. Cook each sandwich for 2-3 minutes per side, gently pressing with a spatula. Once the bread is golden, cover the pan and continue cooking until the cheese is completely melted.