To be honest, if there isn't some sort of gatekeeper - bookstore owner, professional reviewer, etc., then the pool of books you're looking at is always going to contain books of more variable quality than those that have passed through some sort of gate.
One thing you can do is look for other types of hurdles that generally mean books on the other side are of higher overall quality, for instance, is it an older book that's still being published?, or is it translated from another language? In each case, the book's been popular enough to be published at least twice, and got through the "publishing" gate twice.
Speaking of which - "who published the book?" is often a good question to ask. Judging books by their covers gets a lot of flak (idiomatically, at least), but the cover tells you the author and the publisher, both of which are very useful tools. If it's an author you have already read and enjoyed, you're in good hands. If it's a publisher who is known for publishing high-quality books in the genre you're interested in reading, that's also a good sign.
Aside from sticking to publishers and authors you trust, you can also look up books your favorite authors are recommending. If there's a blurb on the back of the book by an author whose own work you like or who is generally well regarded, that's potentially a good sign.
With regard to reviewers, there are amateur reviewers out there as well as professional ones. I'm not talking about reviews on Amazon itself. I'm talking about blogs where someone reviews all their favorite fantasy or sci-fi or mystery or romance books. There are tons of them out there. Maybe look up some books you read recently and actually liked, and see who else out there in the world also liked those books. You may have just found a reviewer whose tastes match yours. That's an excellent resource to have.
Realistically the search will probably go the other way: from book to reviewer, rather than from reviewer to book. When you look up a book's reviews and you find a reviewer who gives a book you're thinking about buying a good review, maybe quickly check what other books that reviewer thought were good. If your most hated book of 2018 is on their "must read" list, maybe that reviewer's taste doesn't match yours and you should give this book a miss.
Admittedly, a lot of these recommendations work better if you're starting with a broader category, like "epic fantasy" or "police procedural" than something uber-specific like "books with specific plot elements x, y, and z" but you can still look up who the publisher is and whether the book has any independent reviews outside of sites specifically trying to sell you the book. You can still see if the people who wrote the blurbs on the dust jacket are people whose taste you trust. There are also a lot of online communities out there where "can you recommend a good book where [x] happens?" is a welcome question (just not Stack Exchange).
There's also just reading the book. Not all of it, obviously, but even if you're buying it online, you can often read an extract. This won't tell you if the protagonist does something really annoying on page 200, but it can tell you if you at least like the author's writing style.
Finally, you could actually go to a bookstore instead of getting books online. The problem you're running into is one that you've already solved, as you stated, "I never encounter any of these problems in the books I buy in book stores." In fact, there's another place you can go that's even better than a bookstore in my opinion - a library. If you're lucky enough to have a good library network wherever in the world you're located, then this is an excellent resource (often it's even an excellent resource of ebooks that you can download from home and which return themselves automatically so they won't accrue any fines). If you haven't paid for a book, it's a lot easier to just stop reading it when it annoys you, and then you won't have wasted your money or as much of your time. (and librarians are also excellent resources for book recommendations.)