The
Galaxy fanboy in me immediately screams "No!" but lets look at this logically.
Remember that, in both the real world and the Trekverse, the
Enterprise-D was designed to go even farther into unknown space than the TOS
Enterprise, which was strongly indicated in the first two seasons of TNG. The D was basically a mobile small colony, which explains why she had civilians aboard. (I believe GR thought that people who were going to be that far out shouldn't have to leave their loved ones behind.)
However, as TNG progressed, we saw the D seem to stick closer and closer to home. Does this mean that Starfleet considered the class a failure, or that they simply rethought their deep space exploration missions? The D was, after all, the Federation flagship, so perhaps it was felt her presence was needed closer to home in a time of strife? After all, losing the flagship during a time when the Borg have emerged, the Klingons are almost at civil war and the Romulans have reappeared might have been a devastating morale blow to the Federation.
Additionally, the TNG TM suggests that six original
Galaxy class ships were built, with six more spaceframes held in "reserve." The DS9 TM suggests these six were quickly made ready for combat and launched with many of their non-combat facilities incomplete. Personally, I think the numbers we saw on DS9 suggest that even more of them were built, and that means to me that the class wasn't a failure.
Also, I think it's important to note that the
Galaxy class wasn't just an exploratory ship. It was designed to do lots of things, and for my money was the closest thing the 24th century Starfleet had to a full-fledged battleship.
Were they a failure? No.
Were they put in situations where they were pushed to, and beyond, their limits? Yes.
That would be my assessment.
obsolete Bird of Prey vs Galaxy class
btw didn't the BoPs shields hold up well?
The Klingons had an unknown spy on board, remember? They had the shield frequency. For all intents and purposes, she had no shields. For all we know, the shield generators were damaged on the first shot.
Logically, no, it isn't a failure. But if, say, any military vehicle of the modern U.S. armed forces had the same sort of record, you can bet the designers would get called to testify on Capitol Hill. In other words, politically it doesn't look good.

EXACTLY! that's why I think we saw such an increase in smaller more mission specific vessels, like the AKIRA (war) NOVA (science) DEFIANT (escort/ battleship) INTREPID (exploritory) SF could not afford to lose another BIG mother ship like the GALAXY again! Can you imagine how the MEDIA must have hounded down Starfleet admirals asking why they seemed to keep loosing there best & safest(remember families are suposed to be own board) ships? It's not good PR people!
Remember the old adage: "Jack of all trades, master of none"? If anything I'd say the D was designed to do
too much, and the apparent shift towards smaller ships indicated a doctrinal shift away from "bigger and better."
And, regarding the
Sovereign class, I would suggest that it was in no way a replacement for the
Galaxy class given the many differences between them. It, too, appears to be a product of the "specialization" doctrine, and for my money is a replacement for the aging
Excelsiors.