There are far more male bosses than female bosses. Accordingly, assuming bad bosses are relatively rare, it's far more likely every female boss you've ever had is awful than every male boss you've ever had is awful. This is just probability.
Let's take an example. Suppose 10% of bosses are awful, regardless of gender. Further suppose that due historical societal reasons, only 20% of bosses are female. If you've had 3 different bosses in your career, there's a far likelier chance that every female boss you've had is awful (3.94%) than every male boss you've had is awful (1.4%). (I'll leave it as an exercise to derive these numbers).
So, even if men and women are just as likely to be awful, you're nearly 3 times as likely for all of your female bosses to be awful than all of your male bosses to be awful simply due to the fact that women are under-represented.
This probability may explain at least some of this common and sad bias against female bosses.