YANBU if you know for sure your child would not have been able to comprehend the situation and not been able to supply the 'I am sorry' as requested.
If he could have made he apology but you felt it was better to handle it away from the 'scene', then, IMHO, that was a bit unfair. This is because your child banged into the door, it was an accident, so it would be polite to say sorry.
Any child can learnt to be more careful and learn to take responsible for their actions, but only if they can comprehend what it is about, which you would know of your child better than any others.
It is not humiliating to say sorry when we do something wrong, even by accident. And I think children should not be afraid to say it was an accident.
My dd has autistic tendencies and finds it very hard to ever admit she has done anything wrong. She will lie about it, making it many times worse!
I really want her to understand that the consequences for saying sorry for an accident are much better than trying to cover up and pretend it was not her!
If the other woman had attempted to humiliate your child, you would have been well within your rights to bundle your child back into the car and ignore her.
An apology is not such a big deal; but only you know how capable your child is to comprehend what that was all about.
In terms of whose car it was - you said she was a friend of the driver (because she was in the passenger seat presumably). But you don't necessarily know if the car was her sister's, auntie perhaps even her daughter's car, and maybe the driver was timid and afraid of confrontation so she was sticking up for her friend. If you think of it in that way it does make more sense than her just randomly pitching in.
Anyway, I am sure all is fine now. I cringe in car parks and shout 'open the door' carefully as I am afraid of just this! So on balance you choose to handle it your way and that is OK.