In "Canadian man found not guilty of raping wife", a sexual assault prosecution failed due to mens rea because it wasn't proved that the man knew his behaviour was illegal. Not because he didn't know that the sex was not consensual, just that he thought non-consensual sex was legal (it has been in a wide variety of jurisdictions belonging to many different cultures, and still is in others).
Has such a defense been used before, either in Canada, or other countries with a similar legal system, such as the UK or Australia, for sex without consent? If so, have courts decided whether or not it is a valid defense, and if it has been ruled a valid defense, have such cases been appealed?
The section on mens rea in the Wikipedia article "Laws regarding rape" only talks about ignorance about whether the sex was consensual. The section Ignorance of the law and mens rea gives as an example someone making a mistake with their taxes, which seems fairly different to the scenario discussed here.