Ming @ Agents of Speech explains that echolalia in children often reflects how their brains process language in chunks rather than word-by-word, and a lack of social restraint to suppress them. A French-language story shows how these phrases can pop out whole and out of place.
Chapters
Autism children, they will echo a lot. That's because the interests are different. Therefore, when they do have this gestalt language processing going on. Echolalia happens when a child is thinking about something else, or they might be using the wrong phrase for the wrong language. Use the fastest language they could grab from the brain because they've been thinking about it all day long. Long time ago, I learned French. Now I've forgotten all of my French. All the words that I know are in chunks. If I say I go fishing, it's j suis a la peche. But I don't know how to cut it up. So when I meet my French teachers now, that's probably the only phrase that pops in my head. And if I didn't have any social restraints to restrain myself from saying the wrong thing, I will probably say that if you get what I mean. Children cannot limit and try to hold themselves back from saying something inappropriate. Is it autism? No, not really. It's just that a lot of children, they cannot really hold themselves from saying inappropriate things.