The existence of the Valiant wasn't a problem for me. Sitting in Starfleet Command right after a Galaxy class was blown up pretty easily by a few small Jem Hadar ships in episode "The Jem Hadar", they're thinking "Uh-oh. We're gonna need a better warship." So they look at what they've got: USS Defiant in mothballs. It had the potential to be a fantastic warship, if they could get the bugs worked out. Well, who was in charge of the Defiant project? Commander Benjamin Sisko? Oh, he's at DS9 now. He's got a pretty good engineer there too, O'Brien... yes he's enlisted, but he just turned down a commission, he's up to a challenge. We'll send Sisko the Defiant and let him and his engineer work out the bugs. Sisko would love a chance to finish the Defiant project. So they send the Defiant to DS9 and at the same time start producing more Defiant class ships as quickly as they can. That was the end of DS9 season 2. The Valiant with Red Squad was found near the end of season 6, and she was out of touch with Starfleet for a year. So Starfleet had three years making Defiants before one of them was made a cadet training ship. There's even some logic to training cadets on a new type of warship so some officers aboard new Defiant-class ships are familiar with them.(It mentions Defiant being the one and only prototype for what would have been a new class of starship, with one single purpose (fighting borg), until "Valient" shows up for zero reason except to confuse the audience as a cheap gag, since there's been no borg there or anywhere near there or anywhere zillions of solar systems away from there. So it's more headcanon time, maybe they added more bolts to the chassis so it wouldn't rip apart at top warp and now built more to allow cadets to command it when all the adults died or whatever, but this is getting way too far off (read "scope creep") so I'll reel back...)
However the big problem is that the cadets didn't make contact with Starfleet as soon as possible when all their real officers had been killed. They were busy carrying out orders made a year before! And they've got one of the best warships in the fleet. It should be obvious that Starfleet priorities might have changed depending on how the war was going. And that possibility of all the commissioned officers being killed should have been covered in their orders as well.