The key legal issue is whether there was a major or minor deviation from the prison guard’s ordinary scope of employment. Right now, the employer isn’t liable for major deviations by their employee and with independent contractors showing vicarious liability is generally an even more uphill battle.
I personally think the bar for vicarious liability should be much lower for employees where their employer had custodial custody of the victim (such as prisons or immigrant detention centers) and that independent contractors should be treated as normal employees for vicarious liability purposes. For now though, the law is what it is until/unless it gets changed.
I think a key part is something here a lot of people are forgetting. The current law was likely applied here correctly. Even if one believes the prison was still at fault they should focus on fixing the law to prevent future instances such as this. Overall I am happy the direction of this thread included legitimate legal discussion about what happened in the case , rather than purely focusing on a moral failing. Even if the discussion on USGD isn't always great its usually much than most internet political boards.