I was skeptical at the time he built them, but he assured me it would hold the weight. I have recently been learning a bit about working with wood, and had not long ago realized how vulnerable these shelves were. I had been planning to either replace them, or add some more brackets and a 2x4 along the front to support the front from the joists. But I never seemed to have the free time, and it didn't seem to be an emergency. . .
From what everything I can see and what most other people have suggested, these 2 things are secondary. The main weakness of this shelf is that the back of the MDF if only secured into the back "batten" with nails. If you think of a bracket as a triangle, the top rear of that triangle where it goes into the wall is where the thing has to be secured the best. In this case your triangular bracket is made up of the shelf on top, the 45 degree support beam in front, and the stud in the wall at the back. That intersection between the back of the shelf and the rear batten that attaches to the studs, held only with nails, this is the weak point in this setup.
Personally, I fix this part first, with something like 1.5" x 1.5" maybe two strips of 3/4" thick board glued together (maybe cheaper at the local store than trying to find 2x2", if you have a suitable way to rip) and glued in the corner between the back batten and the bottom of the shelf. If there's a gap developing anywhere, already (e.g., you can see all kinds of daylight in this seam in your first pic, on the back of the shelf to the left of the one that fell out; this is probably why the brackets failed, because the shelf was pulling away from the wall and bending/pulling the bottom bracket screw out of the stud with tremendous force), I think I might remove everything and get up there with a hammer and some more nails to snug it tight, first. But this depends on what my level and square says*. Again, make sure there's at least one screw through this back strip in a stud, every 16", before you glue this up. I would just leave a gap in this reinforcement where these screws are, in case someone wants to take this whole thing down, one day. So these reinforcement would be ~15" in length, with the 2" gaps centered over the studs. Glue up, stick the pieces in place, add a few nails to hold it while the glue sets.
Second, for the lip, I would use a smaller maybe 3/4" x 2" lip to the front with glue and nails. Placed at a right angle, of course. If I want more support than that I'd add a second strip back from the front one. This one might be easier to put in with counter sunk screws from the bottom to keep it in place while the glue dries. A single 2x4 at the front lip is excessively heavy and also will look crude, IMO, unless you have a jointer to clean them up. They will also not glue too great, raw, unless you have a bazillion clamps. Also might want to look into channel iron with pre-drilled screw holes. Angle iron (or individual small, predrilled right angle brackets) might also be good to secure the rear of the shelf to the batten, but IMO it takes more work to drill and screw. And the screws should be very close the the inside corner where it goes into the batten, unless the steel is very thick and rigid (and that means heavy and expensive), so there's not necessarily room for a good angle for a drill.
Last thing I would add is more triangular brackets/supports, because in my estimation that's the last thing it actually needs. Highly doubtful that this is how and why it failed. Plus your studs are every 16". So if you add more brackets you would end up with either 3x as many or an extra bracket 1/3 the distance between the existing ones. I'd have maybe built it same as this guy did, every 4 feet. I suppose you could play musical chairs and shift some of the existing brackets to make them every 32". I bet the pieces of MDF for your shelve are a multiple of 4 feet in length, each, though. I'd make sure there are actual screws, at least 2 or 3 small screws, through the MDF and into the top of each bracket. Spaced out so that the MDF doesn't tear out under high load. The one single screw at the bottom is probably fine, so long as the back of the shelf is rigidly affixed to the back batten.
*this is where a slide hammer might come in handy. I've often wanted one but never got around to buying or making one, yet. I might jerry jig something up if this were needed. I think it might be easier than turning into spiderman. Screw into the bottom of the shelf and smack it back down, tight. Also smacking the front of the shelves with a 3 lb mallet towards the wall to get it to reseat, properly, where the nails pulled out and away. Another possible method is to drill some large holes through the bottom of the shelves at the back, big enough to slip a small clamp through, to clamp them down to the back batten while gluing in the reinforcements.