Preheat the oven to 450°F. Place a large rimmed baking sheet in the oven while it heats.
In a large bowl, toss the wax beans, onion, and garlic with 2 tablespoons of the olive oil and the salt. Transfer to the baking sheet and spread out evenly. Roast until the beans are lightly browned and tender, 20 to 30 minutes, then scoop the bean mixture onto a cutting board and let cool slightly.
Pick out the garlic and squeeze the soft cloves into the bowl you used for tossing the vegetables before roasting. Use a fork to lightly mash the garlic. Whisk in the remaining 3 tablespoons olive oil, the vinegar, sugar, and pepper.
Cut the roasted beans and onion into 1-inch pieces and add them to the bowl with the dressing. Stir in the white beans, kidney beans, celery, and parsley and gently toss to combine. Taste and add more salt if needed. Sprinkle the feta on top and serve.