Heat oil in a large nonstick skillet over medium. Add onions; cover and cook, stirring occasionally, until softened and starting to brown, about 20 minutes. Stir in salt and pepper. Reduce heat to medium-low; cook, uncovered, stirring occasionally, until onions are very soft and dark golden, 30 to 40 minutes, stirring in 1 to 2 tablespoons water as needed if pan bottom gets too dark.
Stir in butter, sherry, and beef bouillon paste. Cook, stirring often, until butter melts and sherry evaporates, about 2 minutes.
