What if you believe something to be a sin but it turns out the act was not a sin. Would you have actually been sinning, since you went against what you though was Gods law deliberately?
It would indeed be a sin. St. Paul makes this very clear in Romans 14. The sin in this case, however, is not the same as doing an objectively evil act. Instead, the sin is being willing to do the evil act that you thought you were doing. Thus if you thought that eating meat offered to idols was wrong (even though objectively it is not wrong according to St. Paul) and you went ahead and did so, your sin would reside in being willing to do something that you thought was wrong. Thus you were willing to violate your conscience and do something you believed to be contrary to God’s law.
One pastoral note in this regard: Sometimes people with a scrupulous conscience get into situations where they feel that they are violating their consciences all the time by what they do. The above account does not always apply in their cases. It applies to a person with a normal or lax conscience. If you need an explanation how matters work with scrupulous individuals, let me know.