The verse says in the begining of the Parsha "and G-d shall forgive her". Rashi says it's refering to a girl who's father had annuled her oath without her knowing, and she acted contrary of her oath (with the understanding that she was transgressing her oath) she needs to get forgiveness from G-d

From here we see , one is held accountable for the intent to sin

This seems to contradict the gemarah in Kiddushen 39B that Hashem doesn't consider a thought to sin as if he sinned , even if the only thing that stopped him from sinning was something out of his control (ex. his car broke down).

The Trumas Hakri answears that the reason why Hashem doesn't considered a thought to sin as sinned because, always, at the last minute he can change his mind and not do the sin. The case of the oath, where she went through the action of the sin, so you can't say she might of refained anyway, so she is held accountable.

In my humble opinion, I want to answear in the following: Rabbi Shimon Shkop asked the

If you have a doubt if something is forbidden, in which the law is to act stringently, is it that if in heaven it is known to be Kosher, there is no sin, but you can't play Russian roulette and act as if it's kosher. Or the torah has a special prohibition of doing questionable acts, as if commanded "though shall not do anything questionable.
Assuming that it is a prohibition to do anything questionable, then even if it is realy kosher, you sinned by doing the act while you were in doubt. The more so, if someone's under the impression that something is a sin, even if it comes out that it wasn't, it in itself is a sin to do something that is presumed to be prohibitted.