Looking at the documentation for some other custom functions, it seems that the standard is to show an example of the function and its result, rather than an example of its use in a line of code. That being the case, I don’t think it’s an error in the docs.
And I suggest that the present style of examples is more clear-cut than any other - the reader’s focus is solely on the function and the finger pointer is a neat way of showing the outcome.
There is an AppleScript statement and an AppleScript( function. The statement, like all statements, requires a space afterward. The function, like all functions, requires NO space. There are two documentation pages, if you want to use the statement, look at that page
if you want to use the function, make sure that you look at that page.