Man, this is a complicated question. Deliberately. That’s just one of the many business benefits of AI’s and complex algorithms — they make assigning blame much more difficult.
“But, bc–” you may ask, “won’t these AI’s and algorithms be owned by the companies that use them, making those companies responsible for their mistakes?” Yeah, theoretically; but you’ll need to prove that their errors were actually errors; you’ll also need to prove that those errors are due to negligence on the part of the company that made or commissioned them. I hope you’ve got advanced training in mathematics and computer science, then.