I noticed copying & pasting code / bash commands out of Microsoft OneNote (for Mac) into Google Cloud Platform CloudShell would cause every command to fail. I would get unknown parameter exceptions and similar. When I type in the full command into CloudShell manually, the same command would succeed.
The same seems to be the case for the Azure az CLI. In fact, something is happening with the way the text is copied (and formatted along the way maybe?) that breaks it in the terminal.