To be reliable, the UPS needs to be regularly tested and that by itself tend to cause failure unless the designers, builders, and installers were all unusually competent.
I'm reminded of the (probably made-up, but told to me as true) story of the facility with a standby diesel generator that was regularly tested, and always worked perfectly until the utility power went out for real. The generator wouldn't start when needed. It turns out that the generator used an electric start motor, and the starter motor required power from the mains.
On a separate note, I live in Northern California, where the local power company has started a policy of deliberately shutting down the power when we have high fire danger, to lessen the risk that one of the utility lines will spark a wild fire. This past October, my home county had a complete utility power shutdown for 45 hours. During the outage, I was listening to the fire dispatch radio channel. The outage started after sunset, and the following day around midday, after the power had been out for around 18 hours, I heard firefighters dealing with a call to a local elder-care nursing home. It seems the building had a standby generator that somehow overheated and caused a fire in the building. They had to evacuate residents. The fire was inside the walls of the structure, and they had to chop into the walls to extinguish the fire. Since I was only listening to the chatter over the radio, I never heard about the results of the investigation, if any. I'd guess that the generator lacked adequate ventilation and/or cooling system, but it seems to have lasted the better part of a full day before catching fire. It probably would have passed a test run of a reasonably short duration.
It's often difficult to mitigate against rare problems.