For the caramelized onions: Add the butter to a medium skillet over medium-low heat. Add the onions and cook, undisturbed, until the bottoms of the onions begin to caramelize, 10 to 15 minutes. Stir once, then cook for another 5 minutes, undisturbed, until golden. Deglaze with the sherry. Season with salt and pepper and set aside.
For the patty melts: Heat a large cast-iron skillet over medium-high heat. Form the meat into 4 balls with your hands. Season both sides with the garlic salt and some pepper. Smash to the desired size (matching up with the size of your bread). Griddle each side until crusty, very seared and about medium/medium rare in the interior (about 130 degrees F), 5 to 6 minutes a side. Thoroughly wipe clean the skillet and reduce the heat to medium low.
On each of 4 slices of rye, place 2 slices of cheese, then a patty, then some onions, then 2 more slices of cheese and finally another slice of rye. Butter both sides of each sandwich (crust to crust is a must) and griddle until the bread is slightly golden and the cheese is gooey, 2 to 3 minutes per side (dome with a metal bowl if necessary to ensure the cheese melts). Serve with your favorite yellow mustard if desired.