When authors attempt to write dialogue or some lines of text in a language that they plainly do not speak. Especially if it's a language with tons of speakers, so it wouldn't exactly be difficult to locate someone who could proofread your text to make sure you haven't made mistakes.
I remember one book where a character occasionally spoke in Spanish. Which was fine, except the author apparently wrote said character's dialogue by running sentences in English through Google translate or something. Seriously, Spanish is a major world language! It's the first language of millions of people, and millions more (such as yours truly) can read it well enough to tell that in the space of 3 sentences, you have assigned the wrong gender to three nouns, put an adjective in the wrong place relative to its noun, and had the character using a distinctly Spanish-from-Spain verb form that the character, being Guatemalan, would not use.