Do people get locked up for fatal traffic accidents? Do doctors get locked up if they prescribe a medicine which leads to a patient's death due to a side effect?
Criminal prosecution, in civilized countries, requires both Actus Reus and Mens Rea. If you deliberately commit computer crime using an AI system, you'll already be prosecuted; the cases we keep hearing about from AI labs have no human intent behind them.
The accepted solution to unintended harms is regulation: We have regulations about automotive safety, we have regulations about pharmaceutical testing and approval, etc.