Interestingly though this happened more often before I knew I'm autistic, and that isn't because I've become more guarded and careful but because I am more able to accept myself as I am, tendency to say the wrong thing and all.
I've often explained autistic difficulties in communication by re conceptualising the idea of TOM (theory of mind) as "intuition of mind" and comparing it with the way we catch a ball. We catch (or fail to catch) a ball by reacting intuitively, we use our senses to intuit where we need to put our hands to catch the ball. we don't have a "theory of ball" whereby we work out its trajectory and where we should put our hands to catch it. If operated in this way we'd be too slow to catch the ball however correct our calculations. Similarly, autistic people don't have the typical intuitive way of inferring what others are thinking, we have to work it out, so we tend to be either slow or clumsy in our efforts to respond to spoken communication. We often don't, as it were, catch the ball in real time although we might be great at working out on paper movement is required to catch the ball.
Throwing the ball also requires an accurate idea of where it needs to go and how powerful and in what direction the throw needs to be to get it there. Well-meaning autistic people who constantly "say the wrong thing" don't have the intuition of mind required to say the right thing. We have the ball (a thought in our head something we want to express) but we are unable to see exactly how to get this ball to our intended destination (transmit our ideas in a way that others can understand).
However knowing that I'm not a bad person, I just don't have the information required to "say the right thing" has enabled me to relax and make better use of the information I do have and my essential goodwill. Or maybe it's just as Krishnamurti says "“If you begin to understand what you are without trying to change it, then what you are undergoes a transformation.”
(I first heard this quote on one of the excellent podcasts of Catherine Ingram.)