He may have said it due to his lack of filter but it doesn't mean it's okay. My son is autistic and behaving like an arsehole is not something we enable
Problem is OP’s son would likely not think of this as behaviour like an arsehole. Your child may not be as challenged on this regard but many with ASD are.
A good example. My child sat there, at an age where ‘they should have known better’, and told his grandmother that he loved so very very much ‘you have told us this same story 3 times, we already know it’ with a genuinely quizzical look. Everyone else, including other siblings, is looking daggers at them. Unfortunately any attempt to ‘smooth it over’ by anyone else is met with a double down because, they are right, it is a true fact. Obviously later, I had a talk impressing on them they are never ever to do that again, specifying not only grandmother but any elderly person. They have a complete inability to do the ‘how do you think it makes them feel part’ as their true belief is ‘good that someone has pointed it out’. So it’s just a ‘rule’ that you can’t say it, you don’t need to understand, you just need to know it’s a rule. I can then guarantee that my child will never ever do this again to the day they die as they are happy to follow ‘the rule’.
The problem is you can’t proactively make a rule for every possible social fuck up, and you can never do a generalised thing with ‘if it will make someone feel bad’ as they genuinely have no concept why this would make someone feel bad. So they will never be an arsehole to an elderly person with failing memory again, but will be an arsehole about something else. Not wittingly, not because they are trying to upset someone, not because they don’t care if they are an arsehole or not, it’s just the way some people are. Honestly, while the OP’s scenario would most definitely sting, I can guarantee my child’s siblings would, whilst being hurt, not take it personally as such but would accept the exact same thing could/would have been said to anyone else. I would then add to ‘the long list of rules’ with ‘not to be said out loud, yes, understand you don’t understand but it’s A Rule’ and would get a satisfied ‘okay’.