This is literally the only way we’ll ever get self-driving cars. You have to test them in real life. Simulations and tests tracks can only take you so far. Yeah it’ll probably cost the lifes of some number of people but this will be greatly outnumbered by the amount of lives saved when the technology actually starts working as intented. It’s not like human driven vehicles are exactly safe for pedestrians either.
Also, when a self-driving vehicle fails it almost always means it ends up getting stuck somewhere or blocking the road. It’s extremely rare for it to cause an accident, though that does happen aswell.