Legal immunity is a special protection granted under the law that shields certain individuals or entities from lawsuits, prosecution, or…