In general, it is possible that you did nothing wrong and the derailleur broke. I bet that bike equipment in general has been getting more reliable over time, as processes and materials have improved. However, occasionally, you'll have something fail because somewhere along the line, the processes weren't followed or they got a bad batch of materials, or some other error. To some extent, you're protected by Shimano's two-year warranty (3 for Dura Ace).
In general, keep your bike clean, and pay attention to how things are working. That should let you detect any failures as early as possible. There was some discussion of periodic maintenance tasks here. For example, once in a while, it's good to check the tightness of your bolts - for example, my rear derailleur mounting bolt backed off, which I think may have contributed to it getting caught in the spokes in big-big. If you do this, you also don't want to overtighten the bolts.
Generally, structural failures like this should be rare in high-quality parts from the major manufacturers. Some readers may remember that Shimano is semi-recalling some 11s cranks because they are more likely to de-bond and break (the failure rate is at least 0.7% - the official statistics likely miss some unreported failures, and failures may be more likely in wet climates or climates where the drivetrain frequently encounters salted roads). This failure mechanism wasn't acceptable, as Shimano should have reacted much sooner, and their proposed fix is arguably inadequate. However, it does also show how rare major structural failures are. The recalled cranks were their lightest ones, and this failure was due to design rather than process or materials defects (I think).