I am a student in America. When my teacher and I were talking about Islam he asked will people be punished if they do something wrong thinking it is right and die with it. So they don’t ask forgiveness because they think it is right.
To answer your question, we should know that the person who did "something wrong" thinking it was right, we shall first see if this person has access to information to know if it is wrong or not.
If this person has no means to know that what he/she did is wrong, then there is no need to ask for forgiveness because there is no admission to guilt in the first place.
If however, there was a way for them to find if what they did is wrong, but they were too lazy to look it up, that is a different issue. They might be punished for the laziness and/or the actual punishment for the act itself.