In deciding which agents to query and whether to sign with one, how much weight should the qualities of an agent’s past sales be given?
Not just the level of success the sold works obtained, but also the character of the sold works.
For example, if I take a peek on Amazon at the works an agent has sold in my genre, and the writing style is very different from my own (perhaps to the point that it annoys me) should I put that agent towards the end of my who-to-query list? Or if the reviews on Amazon claim the work has characteristics I wouldn’t associate or want associated with my works (even if they’re not bad characteristics, e.g., “cozy” or “relevant to today’s XXX”), should that be another strike against the agent?
Will this help minimize the number of dreaded “nice but I didn’t love it” rejection letters, and the odds of getting an agent but not finding a publisher through them?
You can prioritize any way you want to.
Some things that are important to you aren't important to someone else.
Thus: how to prioritize your list, what weight to give any one factor, isn't a question that can be answered generally, or by someone other than you.
I think you've forgotten that agents rep a LOT of different kinds of writing. And authors. You don't know if that book on Amazon is the author's best effort, or a book that they bled onto the page under deadline. Or if the agent in the acknowledgements is even the one who sold the book. More than one author has thanked me for a book I didn't sell (which is lovely, and leads to some very interesting queries!)
If you write crime novels, and you "peek on Amazon" at the books I've sold, you'll find traditionals like Faithful Unto Death by Stephanie Jaye Evans; you'll find Blood Standard by Laird Barron; you'll find Crashers by Dana Haynes. I think all are well-written, but you can disagree with me. (You'd be wrong of course, but that's your right.)
I challenge you to describe what I like to read after looking at that list.
If any of those books are ones you'd be be reluctant to be associated with, do me a favor and leave me OFF your list.
Your goal is not to minimize rejection. Your goal is to find an agent. Those are not the same things.
Query widely, sign smartly.