Place potatoes into a large pot and cover with salted water; bring to a boil. Reduce heat to medium-low and simmer until tender, about 20 minutes; drain. Set aside to cool in a large bowl.
Preheat oven to 350 degrees F (175 degrees C). Grease a 1 1/2-quart casserole dish.
Heat a large skillet over medium-high heat. Cook and stir ground beef and onion in the hot skillet until the beef is crumbly, evenly browned, and no longer pink, about 10 minutes. Stir green beans and tomato soup into the ground beef mixture; transfer to prepared casserole dish.
Mash the cooled potatoes with milk, egg, garlic, pepper, and salt; spoon in mounds over the ground beef mixture. Sprinkle Cheddar cheese over the potatoes.
Bake in preheated oven until cheese is melted and edges of dish begin to brown, 25 to 30 minutes.