Rides go down for a wide variety of reasons, many of which have nothing to do with maintenance. They do plenty of work in the off season and at night to keep the rides in good shape. I've visited in the off season several times and experienced the refurbishment schedule first hand--there are often MANY rides down in the winter. In general, this allows all the rides to be open during the busy summer months. So, yes, rides are maintained and refurbished regularly outside of peak season and park operating hours. And yes, despite
Disneyland's best efforts, rides still breakdown or close temporarily throughout the day.
Disneyland really has little to no control over many of the things that will bring a ride down temporarily, like hats/bags/glasses that weren't properly stowed and fly off and land on the track or if guests don't follow the safety instructions. On some of the rides, if guests take too long to load or unload, it causes a hiccup and the ride needs to be reset. They also can't control things like "meteor showers" on Space Mountain, which require them to close the ride to clean up after sick guests. It also seems logical to me that the busier the parks are, the more people riding a given ride, the more likely it is that something like a hat on the track will happen over the course of a given day.
I also think the ride concentration makes it seems like rides go down at DLR more often. The official website lists 41 attractions for Magic Kingdom and 53 for Disneyland. The greater number of attractions in a considerably smaller space combine to make the breakdowns more obvious, I think.
That said, there are some rides that are more prone to "breakdown" than others. Indy seems to be one. If it's raining, RSR tends to have issues, as well. Those are some of the most complex rides in the park, and that seems to lead to more shutdowns than the simpler rides. Knowing that, they're just on my "check back later" list if they're down when we walk past the first time. They tend to come back up pretty quickly.
While ride "breakdowns" are annoying, I'd rather deal with a ride being down for a portion of the day if it means that they're following the safety protocol and keeping the ride maintained. It's annoying, to be sure, but a lot less annoying than having people be injured if something is truly wrong with the ride.
Hope your friends were still able to enjoy the parks, even with breakdowns.