Mens rea means you intended to do the criminal thing that you did, not necessarily that you knew it was criminal. Homicide is homicide because you intended to kill someone, even if you didn't know that was a crime; if you did not intend to kill someone, you lack the
mens rea but may still be guilty of negligent homicide or some related crime.
Certain crimes do require knowledge of the law, like tax evasion: the tax code is assumed to be so complicated that to be guilty of criminal tax evasion it must be proven that you knew you were evading taxes. Wikipedia has a summary: https://en.wikipedia.org/wiki/Mens_rea#Ignorance_of_the_law_...