There are sins which a person does not even know are sins and even, on occasion, thinks that they are good deeds in the way that it says in Mishlei that “There is a straight path before a man and its end is the way of death!” in the same way that the Talmud related about Rabbi Akiva who at the beginning of his learning found a Meis Mitzvah (A body with no known relatives to bury him) and he put it on his shoulder and took it to the town where his teachers told him that for every step that he had taken with it on his shoulders he would be judged as if he had committed murder (as a Meis Mitzvah acquires its place and is buried in the place that one finds it) at which point Rabbi Akiva said “If I thought I was doing a Mizvah it ends up being a sin, when I think I am doing a sin it will definitely be a sin!”. Immediately, he undertook to occupy himself with Torah.
The evil of the people of the land is great as they walk in darkness, they forbid that which is permitted and permit that which is forbidden, and Hashem will bring to justice for everything, for the accidental ignorance of not learning is considered like having deliberately transgressed. One who has not learned at all nor listened to others learning will find that there is no second without transgression and no step without a mistake. The Sefer Chasidim also writes that a person is judged and punished even for that which he did not know because he did not try to know and the proof is that the verse says “I have sinned, for I did not know that You are standing towards me!”, which means to say that I have sinned in that I did not pay attention to know and to understand that You are standing towards me.