Had a close call with a cave in on one of my first basements many years ago. Two service trenches, about 10' apart. Dug one, backfilled it, dug other and as I started to backfill a massive part of the bank between the two let go, it was like 9' high bank, if someone was in the trench they would have been dead absolutely no question about it, and I was in there only maybe 45 minutes prior. Was a big wake up a call, and good lesson about banks that I thankfully didn't learn the hard way. 5' is legal here, over the years i've got where I know when i'm digging if the dirt is stable and what i'm comfortable going in. For virtually all my sewer and water trenches I keep the 5' bucket on to make it safer, and bench down the sides. Problem is the bank against the city property is always going to be over 5' and you can't dig it to slope or bench it back, had some as deep as 13'. Did a repair a few weeks ago 13' down no possible room to bench or slope so rented a trench box, they sure are handy. It's amazing how dumb some people are though, the customer figured I was going to do the repair without a trench box, a hole 13' down only 4'x6' in size, ya let's just dig my own grave.....
A temp worker got buried and died here a few years ago, contractor went to jail I believe, and even the builder got it really bad. One "new Canadian" company I watched doing services here they had a 2' wide trench it was 12' down easy, no slope or benching and they were driving the 200 hoe back and forth at the top while guys were in the trench. Baffled they haven't killed someone yet.