Vittorio, the key to recognizing the error in your original post is the word “automatically.” The relationship of the soul and God is intimate and personal and there is nothing automatic about it. God knows your heart and your intentions and cannot be fooled, even though we can sometimes fool ourselves. He knows us better than we know ourselves and loves us more than we can love ourselves.
He sees the reality of every situation and is ready to plunge us into the ocean of His mercy at the slightest sign of repentance. We need only be honest and sorry.
What you may be thinking of is that sometimes an action that is not normally defined as grave matter can be a mortal sin for a person who is convinced that the action is seriously sinful. Let’s make an analogy to illustrate. Suppose there is a person whom you wish to harm, and you believe he has a certain food allergy. You cook a dish and include the allergen among the ingredients. You are surprised when the person does not become ill after eating it, because he is not actually allergic to the item. Wouldn’t you expect the relationship to be seriously damaged if the person knew what you had done?
The same thing happens with our belief about the sinfulness of our actions. To use the example in the post above, if you sincerely believed that driving 56 mph in a 55 mph zone was a mortal sin, and you did it anyway, you would be guilty of mortal sin. You were willing to do what you thought to be mortally sinful. God sees that in your heart and is offended just as He would be about a real, objective sin.
This is the flip side of ignorance excusing some things that are sins. If you are really, honestly misinformed about the seriousness of an action - if you truly believe it is not a sin, then, for you, it is not. And if you find out later on that the action is sinful, it does not retroactively become a sin. However, you must not do the action again, now that you know its sinfulness.
The key is honesty. God knows all, and it does no good to fool ourselves.
Betsy