I don’t have enough information to give you much of an answer. I can only make a very tentative guess.
You see, I have to wonder why two adults in their 40s who love each other would decide not to have sex. That decision is where I think the problem begins. Of course you “gave in” and had sex. Why shouldn’t you? Sex is a normal and natural and important part of connecting intimately with someone you love. But for some reason you can’t let yourself be intimate and you feel bad if you “slip.”
It makes sense that tension would develop between what your body and emotions want and what your mind has decided it won’t do. A resolution to the discomfort of that tension is to shut down entirely, which you apparently did. That brings me back to my original question: Why on earth would two adults in their 40s give up on sex when they love each other?
For an answer to that question and perhaps to resolve it, I think you need to see a therapist who can hear the whole story and who can perhaps help you make peace with being sexual human beings. I hope the two of you will do that. People who love each other deserve the pleasure and satisfaction that comes with being close and sexually intimate with each other.
I wish you well,