salam eliiah
I think the word "jahala" in this ayah may refer to "doing something out of extreme emotions". I read about this somewhere. Usually we say "not knowingly" but that doesn't sound exactly right to me. It's more like "when you really can't help yourself, can't see the consequences, can't think straight, commit a sin, but then you immediately realize what you've done, asked for forgiveness and made tawba".
When you look at 12:33 for example, you can see that Prophet Joseph (pbuh) says that "he might not find the strength to resist them if ALLAH does not avert him from their plan."
"He said, "My Lord, prison is more to my liking than that to which they invite me. And if You do not avert from me their plan, I might incline toward them and [thus] be of the ignorant."
It's just an opinion by the way. Maybe someone will answer differently and more correctly. May ALLAH (swt) guides us to His path and forgive us if we are wrong.