Heat oven to 375°F; line an 8-inch square pan with parchment.
Mix beef, breadcrumbs, egg, milk, salt, pepper, 1/4 cup ketchup, and Worcestershire just until combined.
Press evenly into a 1 1/2-inch-thick loaf in pan. Spread remaining ketchup over top; bake 35 to 45 minutes until center reaches 160°F.
Rest 10 minutes; cut into 6 firm rectangles.
Heat oil on a griddle over medium. Brown onion 8 minutes; move aside. Griddle meatloaf slices until centers reach 165°F.
Toast sourdough on griddle; spread with mayonnaise. Fill each sandwich with one meatloaf slice and onion.
Close; cut once across middle.