I would dispute the argument you make. There is certainly less "gee-whiz" science, and many people no longer expect that science and technology can solve every problem anymore, but I don't think that means there is a larger proportion of dystopian stories being written than before.
1950s-1960s science fiction predicted a bright future for humanity
I don't think so, it is merely that those authors and book/short stories are no longer popular today. Many stories from that time were written in a bleak landscape of post-nuclear warfare. For example, PKD stories have become a Hollywood film staple in recent years, and yet a large volume of his work was about people surviving in underground bunkers.
very few people in the developed world have ever been bombed or lived in smog-filled cities
They may not have "experienced" bombing themselves (if you mean in the manner the Blitz or Aleppo) but many have lived with the threat of terrorism, some for generations. There is no doubt that the incidences of terrorist bombings has risen more recently. However, I'd say that the fear of that threat is, and always was, more pervasive than the experience itself.
City air is not clean either. Coal is no longer used as a fuel but smog is no longer defined as a mixture of smoke and fog. It is used for any abnormal concentration of matter in the atmosphere which is sufficient to harm or annoy people. Car exhaust fine particulates, together with nitrogen oxides reacting with low level ozone, are killing people and making them physically unwell. Our rivers may have less raw sewage and industrial pollution dumped in them, but even in unpopulated places, the streams have fertilisers, antibiotics and insecticides (from dog flea collars) in them.
I agree with
@paeng that science fiction has always reflected readers, viewers, and also the writers, situation; their hopes and fears. People are still worried about the world, but those worries have changed and may be different. Science fiction was always about the "now" as well as about the future. We no longer discuss current affairs on these forums because people have shown that they cannot argue them calmly, so can I ask that any discussion of world events in this thread is kept to a very general level, without introducing politics. However, that very polarisation of opinions might also be a factor if the stories appear to be more "doom and gloom" than they once were.