The actual problem might rather be that the syntax help is ignoring trailling spaces (see MC-165061). Removing trailing spaces when running a command might not be the wanted behavior, see also MC-65034.
Example in a command block: "setblock ~ ~1 ~ stone "
MC-165061Command blocks ignore trailing spaces when checking syntax
MC-65034Chat, /tellraw, and other commands trim excess whitespace