Poor planning aside, it still sounds a little bit like a DM gotcha to me when they got discovered.
The party has plenty of time to climb over the wall, but it isn't until they're all over and completely committed that POP! you immediately spring a guard patrol turning the corner on them. They just happened to turn the corner at that moment, not any earlier when they're just starting to climb over and maybe realized they missed something, not at a moment when they could attempt to retreat or escape, or one minute later after they've broken into the house. Maybe they didn't scout the patrols well, but that's awfully convenient timing.
If the party was surprised by the guards and thus weren't given a chance to react in order to silence them before the alarm was raised, that would make it even more of a gotcha. Was that the case?
You can blame the players for bad planning and for screwing things up, but there are a lot of things that aren't in their control that make their failures catastrophic. Maybe they didn't scout the patrols as well as they could have, does that mean you should spring a patrol on them the instant they're vulnerable? That might not have been the best choice in terms of maintaining player morale.
No, they weren't surprised. They had the chance to react quickly and throw the silenced rock over to where the enemy was before they could give a shout.
And then they fireballed them....